CsvItemExporter fails on py3 #2553
Comments
It appears to be a problem with your "with open('temp.csv', 'w') as f:" statement. The mode you are using does not properly write to the file in the way you need it. When I tested the line myself, I added 'b' to the mode for the open statement. Try the following: om scrapy.exporters import CsvItemExporter I have pasted a helpful link below: |
I think this is working as intended; as @TDominiqueWilliams said, exporters expect files opened in binary mode. |
Example at https://doc.scrapy.org/en/latest/topics/exporters.html shows that the file should be opened in binary mode. But we don't document explicitly that |
Thanks, makes sense now |
That'd be awesome! |
The previous snippet works fine on python 2, however the following error appears when running on python 3:
Am I missing something? Thanks!
The text was updated successfully, but these errors were encountered: