A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/021111.html below:

[Python-Dev] Next version of PEP278 - universal newline support

[Python-Dev] Next version of PEP278 - universal newline support - available [Python-Dev] Next version of PEP278 - universal newline support - availableGuido van Rossum guido@python.org
Thu, 14 Mar 2002 11:17:29 -0500
> Am I the only one who wants universal newlines *without* a new mode
> character?  Ideally I'd like *existing* code that works with text
> files to accept any line ending.

Me too.  But it opens up the nasty problem of the gazillions of
Unix-only programmers who never use 'b' for binary files.  We've fixed
that in the std library (since it's cross platform), but I'm not too
comfortable with imposing this on everybody without a transition
period, given that this is both common knowledge and has "just worked"
for 12 years in Python.

I wonder if it would make sense to put a warning when people use
f.read(n) on a file opened in text mode?  I think f.read(n) is an
almost sure sign that they're seeing the file as binary data.
However, f.read() or f.read(-1) is used to slurp in text as well, so
should not trigger the warning.

Opinions?

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4