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
{{ message }}
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
On DjangoCMS 3.2.5, Django 1.8, Python 2.7 with DjangoCMS Table from master, I can't get the CSV import to work because the CSV reader errors with "iterator should return strings, not bytes" in TableForm.clean_csv_upload().
fromioimportTextIOWrapperclassTableForm(ModelForm):
defclean_csv_upload(self):
ifself.cleaned_data['csv_upload']:
# Make sure we decode the file to textencoding=self.cleaned_data['csv_upload'].charsetifself.cleaned_data['csv_upload'].charsetelse'utf-8'f=TextIOWrapper(self.cleaned_data['csv_upload'].file, encoding=encoding)
csv_reader=csv.reader(f, dialect='excel')
The text was updated successfully, but these errors were encountered:
On DjangoCMS 3.2.5, Django 1.8, Python 2.7 with DjangoCMS Table from master, I can't get the CSV import to work because the CSV reader errors with "iterator should return strings, not bytes" in
TableForm.clean_csv_upload()
.Based on http://stackoverflow.com/questions/16243023/how-to-resolve-iterator-should-return-strings-not-bytes, the following works for me:
The text was updated successfully, but these errors were encountered: