Message83382
Antoine> However, I think csv should accept files opened in binary mode
Antoine> and be able to deal with line endings itself. How am I supposed
Antoine> to know the encoding of a CSV file? Surely Excel uses a
Antoine> defined, default encoding when exporting to CSV... that
Antoine> knowledge should be embedded in the csv module.
In fact, the csv module actually requires files to be opened in binary mode
but doesn't enforce that. That it works in all but a few corner cases is
because so few CSV files contain fields containing embedded newlines.
Why doesn't open() allow you to specify an encoding when opening in binary
mode? Even though it would be unused by the File object, it would serve as
an annotation for code using that open File object so they can do the
appropriate bytes-to-unicode conversion.
Skip |
|
Date |
User |
Action |
Args |
2009-03-09 14:14:12 | skip.montanaro | set | recipients:
+ skip.montanaro, georg.brandl, sjmachin, pitrou, vstinner, jaywalker, jdwhitley |
2009-03-09 14:14:11 | skip.montanaro | link | issue4847 messages |
2009-03-09 14:14:09 | skip.montanaro | create | |
|