Skip to content
Commit 19245319 authored by Daniele Forsi's avatar Daniele Forsi
Browse files

Disable "universal newlines" to avoid unwanted changes

Since Python 3, when reading from a file opened in text mode,
different end of line characters are handled transparently by
default regardless of the underlying operating system, however
when writing to text file the system default line separator is
always used. Disabling "universal newlines" will make foreign
line separators appear in the strings returned by readlines()
and the regexp will handle them like any other control
character (eg. \t) and they will be written to the output file.

The documentation of universal newlines is at
http://docs.python.org/3/library/functions.html#open
parent 9dcd0612
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment