You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR #654, actually break the CSV parsing, when it was working previously... Specifically, in case of dynamic upload in web2py : when the CSV file is uploaded trough the application before import into the database. TextIOWrapper is then already used to convert the binary stream into a string one the second usage in csv.reader raise an exception.
An example of usage in web2py controller typically looks like this : db.import_from_csv_file(TextIOWrapper(request.vars.file_selector.file,encoding='utf8'))
Removing TextIOWrapper from the call don't work, because pydal, 'object' and 'base' class are expecting string and not binary data. Consequently, all the parsing/format tests check for hard-coded string values ( for instance "TABLE' and not b"TABLE"), thus crash when binary data is used.
The text was updated successfully, but these errors were encountered:
jvanbraekel
changed the title
Fix unable to parse csv file in web2py breaks CSV parsing when dynamyc upload is used
Fix unable to parse csv file in web2py break CSV parsing when dynamic upload is used
Oct 4, 2021
Hello,
The PR #654, actually break the CSV parsing, when it was working previously... Specifically, in case of dynamic upload in web2py : when the CSV file is uploaded trough the application before import into the database. TextIOWrapper is then already used to convert the binary stream into a string one the second usage in csv.reader raise an exception.
An example of usage in web2py controller typically looks like this : db.import_from_csv_file(TextIOWrapper(request.vars.file_selector.file,encoding='utf8'))
Removing TextIOWrapper from the call don't work, because pydal, 'object' and 'base' class are expecting string and not binary data. Consequently, all the parsing/format tests check for hard-coded string values ( for instance "TABLE' and not b"TABLE"), thus crash when binary data is used.
The text was updated successfully, but these errors were encountered: