[Csv] Switch to universal mode?

Skip Montanaro skip at pobox.com
Wed Jun 16 04:14:11 CEST 2004


I've been thinking we should enforce universal mode in the csv module.  I
think it could simplify the reader a bit (all EOLs become '\n', right?).
Unfortunately, universal mode is a read-only thing (PEP 278 disallows 'wU'
though the file object doesn't currently enforce that).  Users would still
have to open files for writing in binary mode.

Accordingly, I think we should provide a little help for users in the form
of mode checking and exception raising where possible.  I don't know what
might be possible for file-like objects (e.g., StringIO) that don't have
modes.  Does the attached context diff look reasonable?  All it does is
enforce the relevant modes.  It doesn't attempt to take advantage of the
'rU' assumption to simplify any code.

Skip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: _csv.c.diff
Type: application/octet-stream
Size: 2426 bytes
Desc: not available
Url : http://mail.python.org/pipermail/csv/attachments/20040615/c568dd61/attachment.obj 


More information about the Csv mailing list