You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2022. It is now read-only.
I noticed that the default mode is w, which in tempfile.NamedTempFile() always converts line endings based on the os.linesep. If I have a data with \n line endings, atom_write() by default converts it to \r\n on Windows. And vice-versa on Linux.
Python 3's open() introduced a new option, newlines to improve control over how line endings are handled. It's available in both Python 3 and Python 2 via io.open().
I can work around the problem by specifying the mode as w+b, but then on Python 3 I also have to make sure the string is encoded as bytes. It would be convenient if this library used io.open and propagated the newline parameter. Setting newline='' then does not perform any translation on line endings.
I noticed that the default mode is
w, which intempfile.NamedTempFile()always converts line endings based on theos.linesep. If I have a data with\nline endings,atom_write()by default converts it to\r\non Windows. And vice-versa on Linux.Python 3's
open()introduced a new option,newlinesto improve control over how line endings are handled. It's available in both Python 3 and Python 2 viaio.open().I can work around the problem by specifying the mode as
w+b, but then on Python 3 I also have to make sure the string is encoded as bytes. It would be convenient if this library usedio.openand propagated thenewlineparameter. Settingnewline=''then does not perform any translation on line endings.