Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: > does it mean that if newline='\r\n' is specified all single '\n' > characters are returned inline? Yes.
Let's take a file with mixed newlines: >>> io.open("c:/temp/t", "rb").read() 'a\rb\r\nc\nd\n' rb mode splits only on '\r\n' (I'm on Windows) >>> io.open("c:/temp/t", "rb").readlines() ['a\rb\r\n', 'c\n', 'd\n'] rU mode splits on every newline, and converts everything to \n >>> io.open("c:/temp/t", "rU").readlines() [u'a\n', u'b\n', u'c\n', u'd\n'] newline='' splits like rU, but does not translate newlines: >>> io.open("c:/temp/t", newline='').readlines() [u'a\r', u'b\r\n', u'c\n', u'd\n'] newline='\r\n' only splits on the specified string: >>> io.open("c:/temp/t", newline='\r\n').readlines() [u'a\rb\r\n', u'c\nd\n'] _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3359> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com