Files
python-keystoneclient/keystoneclient
Cyril Roelandt 1ee161e162 cms: Use universal_newlines=True in subprocess.Popen()
The Python documentation states that "the type of [the first argument of
subprocess.communicate()] must be bytes or, if universal_newlines was True, a
string"[1]. Currently, in Python 3, a text string is given to
subprocess.communicate(), even though the process was created with
universal_newlines=False (the default value).

Rather than converting strings to bytes (and the other way around) everywhere
in the code, just create the process with universal_newlines=True. The side
effect is that '\n', '\r\n' and '\r' will be recognized as ending lines[2],
which should not be an issue.

[1] http://docs.python.org/3/library/subprocess.html?highlight=popen#subprocess.Popen.communicate
[2] http://docs.python.org/3/glossary.html#term-universal-newlines

Change-Id: I668b187ba8ed00ad6d55ec487af623b79b21589d
2014-02-07 04:31:25 +01:00
..
2012-09-29 16:03:23 -07:00
2014-01-08 10:57:00 +01:00
2013-12-03 12:00:03 +10:00