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/2003-August/037705.html below:

[Python-Dev] file read-ahead with Mac end-of-line

[Python-Dev] file read-ahead with Mac end-of-lineGuido van Rossum guido at python.org
Sun Aug 17 15:05:30 EDT 2003
> The patch below fixes my csv module problem, but I wonder
> if it's the correct fix.  Suppose you're using Mac line endings and
> encounter a \n before a \r?  This function will return a too-short line.
> (Of course, it would without the patch as well.)
> 
> I don't know how (or if) this should work with universal newline support.
> We expect files to be opened in binary mode, so I don't know if universal
> newline support applies.
> 
> In short, does this look like the correct patch, closer to the correct
> behavior than the current setup, or no improvement at all?

I'm not familiar with the csv module, but if it opens the file in
binary mode, readline() and next() are *required* to only honor \n as
the line end character.  Maybe the csv module ought to open the file
in universal newline mode (f = open(filename, "U")?

The patch you give would make next() behave like universal newline
mode in all modes, which is definitely wrong.

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

More information about the Python-Dev mailing list

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