web2py cannot import csv return strings not byte

44 views
Skip to first unread message

lcham...@gmail.com

unread,
Jan 5, 2021, 6:09:14 PM1/5/21
to web2py-users
To Reproduce

Steps to reproduce the behavior:

  1. Create a new project(New simple application).
  2. Go to Models, and edit db.py
    Add this:

db.define_table('contacts', Field('first_name'), Field('last_name'), Field('company_name'), Field('address'), Field('city'), Field('county'), Field('state_name'), Field('zip'), Field('phone1'), Field('phone2'), Field('email', requires=IS_EMAIL()), Field('web') )
code.txt

  1. Download and unpack attached CSV file:
    us-500.zip (Also you can download "us-500.csv" from https://www.briandunning.com/sample-data/ they shall be same)
  2. Return to the administrative interface, select Manage/Edit onto the project you create.
  3. Press the button "database administration" under the Model label.
  4. Press "db.contacts".
  5. Under the label "Import/Export" press Browse button
  6. Select unpacked CSV
  7. Press import button.
  8. Get same table as it was before(unchanged), and some bubble about the error(which one does not fin into buble).

python 3.7
windows 10

Thank you for your help

Philip Kilner

unread,
Oct 13, 2021, 12:36:09 PM10/13/21
to web...@googlegroups.com
Hi,

I have just been bitten by the same bug.

Reported as: -

https://github.com/web2py/web2py/issues/2404

Is there any prospect of an updated release with a fix for this? I have
attempted to use the fixes that Googling the problem suggests, but I'm
wary of cut and pasting solutions without a deeper understanding of the
issue.


--

Regards,

PhilK


'a bell is a cup...until it is struck'

Clemens

unread,
Oct 13, 2021, 12:43:44 PM10/13/21
to web2py-users
Reply all
Reply to author
Forward
0 new messages