On Wed, 14 Aug 2013 13:05:50 -0400, random832 wrote: > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: >> I'm always and still be suprised by the number of hard coded '\n' one >> can find in Python code when the portable (here win) >> >> >>> os.linesep >> '\r\n' >> >> exists. > > Because high-level code isn't supposed to use the os module directly.
Say what? My brain hurts. The os module is full of lots of platform independent goodies. It is the right way to split and combine pathnames, test environment variables, manipulate file permissions, and other useful tasks. > Text-mode streams automatically convert newlines you write to them. Maybe they do, maybe they don't. It depends on whether Python is built with universal newline support, and what sort of text-mode stream you are using, and a bunch of other rules that make it a little more complicated than just "automatically convert". -- Steven -- http://mail.python.org/mailman/listinfo/python-list