[issue40863] bytes.decode changes/destroys line endings on windows

Matthias Naegler report at bugs.python.org
Thu Jun 4 14:10:38 EDT 2020


Matthias Naegler <matthias.naegler at gmail.com> added the comment:

I forgot something important. Using open with 'ab' works.

>>> ...above code...
with open("./test_binary.txt", "ab") as myfile:
...     myfile.write(s.encode('utf-8'))

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40863>
_______________________________________


More information about the Python-bugs-list mailing list