On 12/08/07, Georg Brandl <g.brandl at gmx.net> wrote: > Note that Python does nothing special in the above case. For non-Windows > platforms, you'd get two different results -- the conversion from \r\n to > \n is done by the Windows C runtime since the default open() mode is text mode. > > Only with mode 'U' does Python use its own universal newline mode. Pah. You're right - I almost used 'U' and then "discovered" that I didn't need it (and got bitten by a portability bug as a result :-() > With Python 3.0, the C library is not used and Python uses universal newline > mode by default. That's what I expected, but I was surprised to find that the PEP is pretty unclear on this. The phrase "universal newlines" is mentioned only once, and never defined. Knowing the meaning, I can see how the PEP is intended to say that universal newlines on input is the default (and you set the newline argument to specify a *specific*, non-universal, newline value) - but I missed it on first reading. Thanks for the clarification. Paul.
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