[issue7262] codecs.open() + eol (windows)

Amaury Forgeot d'Arc report at bugs.python.org
Wed Nov 4 19:02:09 CET 2009


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

The docs say::
  Files are always opened in binary mode, even if no binary mode was
  specified. This is done to avoid data loss due to encodings using
  8-bit values. This means that no automatic conversion of '\n' is done
  on reading and writing.

But this does not match the code of codecs.open()::
    if encoding is not None and \
       'b' not in mode:
        # Force opening of the file in binary mode
        mode = mode + 'b'

When the encoding is None, the file is opened in text mode.
Marc-Andre, what do you think? is it a documentation bug instead?

----------
assignee:  -> lemburg
nosy: +amaury.forgeotdarc, lemburg

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7262>
_______________________________________


More information about the Python-bugs-list mailing list