Bugs item #1714381, was opened at 2007-05-07 16:50 Message generated for change (Comment added) made by gjb1002 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1714381&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Windows Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Geoffrey Bache (gjb1002) Assigned to: Nobody/Anonymous (nobody) Summary: Universal line ending mode duplicates all line endings Initial Comment: On Windows XP, reading a file produced by Windows XP with universal line endings produces twice as many lines! Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> open("winlineend").read() 'Hello\r\n' >>> open("winlineend", "rU").read() 'Hello\n\n' I would expect the last to give "Hello\n". ---------------------------------------------------------------------- >Comment By: Geoffrey Bache (gjb1002) Date: 2007-05-07 22:27 Message: Logged In: YES user_id=769182 Originator: YES I create the file as follows: >>> import os >>> file = open("test.txt", "w") >>> file.write("Hello" + os.linesep) >>> file.close() >>> open("test.txt").read() 'Hello\r\n' >>> open("test.txt", "rU").read() 'Hello\n\n' ---------------------------------------------------------------------- Comment By: Raghuram Devarakonda (draghuram) Date: 2007-05-07 19:39 Message: Logged In: YES user_id=984087 Originator: NO I created a file "test.txt" with notepad whose contents are "hello\r\n". Both open().read() and open("rU").read() returned 'hello\n'. I tested with both 2.5 and 2.5.1 (installed using installers from python.org) and the result is same on both. Can you elaborate your test case more? How is this file "winlineend" created? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1714381&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com