[issue12189] Python 2.6.6 fails to compile a source whereas pycompile 1.0 succeeds

Amaury Forgeot d'Arc report at bugs.python.org
Thu May 26 20:50:35 CEST 2011


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

The problem is probably near this code in Lib/doctest.py (in _load_testfile)::

        # get_data() opens files as 'rb', so one must do the equivalent
        # conversion as universal newlines would do.
        return file_contents.replace(os.linesep, '\n'), filename

probably something like this would be better::

    file_contents.replace('\r\n', '\n').replace('\r', '\n')

----------
nosy: +amaury.forgeotdarc

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


More information about the Python-bugs-list mailing list