I suggest that the hasattr test indicated in PEP-0278 is the bug,
witness:

<pre>
$ od -c dos.txt 
0000000   T   h   i   s  \r  \n   i   s  \r  \n   a       t   e   s   t
0000020  \r  \n   o   f       t   h   e       U   n   i   v   e   r   s
0000040   a   l  \r  \n   n   e   w   l   i   n   e  \r  \n   s   u   p
0000060   p   o   r   t  \r  \n   p   e   r      \r  \n   P   E   P   -
0000100   0   2   7   8  \r  \n
0000106
# very clearly \r\n line terminators
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> hasattr(open, 'newlines')
False
>>> open('dos.txt', 'r').read()
'This\r\nis\r\na test\r\nof the Universal\r\nnewline\r\nsupport\r\nper 
\r\nPEP-0278\r\n'
# yep, the \r\n line ends are there
>>> open('dos.txt', 'rU').read()
'This\nis\na test\nof the Universal\nnewline\nsupport\nper \nPEP-0278\n'
# the \r characters have disappeared
</pre>

** Changed in: python-defaults (Ubuntu)
       Status: New => Invalid

-- 
Python should be compiled with Universal Newline Support
https://bugs.launchpad.net/bugs/570737
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to