Thorsten Weimann added the comment:
Please re-open. The IO system only takes care of line separators, if no
encoding is given.
--
nosy: +Thorsten.W
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20136
Vinay Sajip added the comment:
Please re-open.
This is configurable in Python 3.2 and later using the terminator attribute,
but this can't be added to 2.7 as it would constitute a new feature.
--
___
Python tracker rep...@bugs.python.org
A. Libotean added the comment:
You can go ahead and close this.
I ran some tests and concluded that indeed the IO system will take care of the
line separators.
Sorry to have wasted your time.
--
___
Python tracker rep...@bugs.python.org
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:
--
resolution: - invalid
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20136
___
A. Libotean added the comment:
Let me write also a test for this and come back with a reply.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20136
___
Vinay Sajip added the comment:
Can you please attach a short test script which shows what you consider to be
the failure case / incorrect behaviour?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20136
New submission from A. Libotean:
The StreamHandler implementation uses hardcoded Unix/Linux line separators.
This generates inconveniences when running on Windows as the file viewers
expect DOS line terminators.
I've attached a fix that will use os.linesep as the line terminator thus making
R. David Murray added the comment:
The IO system should automatically take care of the linesep conversion when
writing to a text stream. Are you sure you specified that the output was a
text file?
--
nosy: +r.david.murray, vinay.sajip
___
Python