This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Anthony Sottile, abartlet, miss-islington, pitrou, serhiy.storchaka, vstinner
Date 2020-03-03.09:15:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583226947.93.0.382040094246.issue37330@roundup.psfhosted.org>
In-reply-to
Content
> Thankfully we don't need universal newlines, but no matter if we need them, old versions of Samba will fail to build without a fix-up patch.

io.open() is available since Python 2.6 and handles different kinds of newlines transparently. Example:

$ python2
Python 2.7.17 (default, Oct 20 2019, 00:00:00) 
>>> f=open("test", "wb"); f.write("a\rb\rc\r"); f.close()
>>> import io; f=io.open("test"); lines=list(f); f.close(); lines
[u'a\n', u'b\n', u'c\n']

Do you suggest to change the documentation to suggest to open io.open() for applications which still care about Python 2?
https://docs.python.org/dev/whatsnew/3.9.html#changes-in-the-python-api

Note: Python 2 is no longer supported upstream, I strongly advice you to upgrade to Python 3.
History
Date User Action Args
2020-03-03 09:15:47vstinnersetrecipients: + vstinner, pitrou, serhiy.storchaka, Anthony Sottile, miss-islington, abartlet
2020-03-03 09:15:47vstinnersetmessageid: <1583226947.93.0.382040094246.issue37330@roundup.psfhosted.org>
2020-03-03 09:15:47vstinnerlinkissue37330 messages
2020-03-03 09:15:47vstinnercreate