> 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/)
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