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 csv modules of 2.x and 3.x differ significantly on what type of file they expect - and how it is opened.
Python 2.x: If csvfile is a file object, it must be opened with the ‘b’ flag on platforms where that makes a difference.
Python 3.x: If csvfile is a file object, it should be opened with newline='' also next(csvfile) should return strings (= unicode)
They seem to work fine with sys.stdin, sys.stdout on linux, but it might be an accident.
Note: csv.reader(sys.stdin) is quote common usage.
The text was updated successfully, but these errors were encountered:
The csv modules of 2.x and 3.x differ significantly on what type of file they expect - and how it is opened.
Python 2.x:
If csvfile is a file object, it must be opened with the ‘b’ flag on platforms where that makes a difference.
Python 3.x:
If csvfile is a file object, it should be opened with newline=''
alsonext(csvfile)
should return strings (= unicode)They seem to work fine with
sys.stdin
,sys.stdout
on linux, but it might be an accident.Note:
csv.reader(sys.stdin)
is quote common usage.The text was updated successfully, but these errors were encountered: