cpython: 688d32cdbc0c (original) (raw)

Mercurial > cpython

changeset 99759:688d32cdbc0c

Merge: #22709: Use stdin as-is if it does not have a buffer attribute. [#22709]

R David Murray rdmurray@bitdance.com
date Sat, 02 Jan 2016 15:43:44 -0500
parents 3a6b1186745f(current diff)ded1336bff49(diff)
children 54b36229021a
files Misc/NEWS
diffstat 3 files changed, 15 insertions(+), 1 deletions(-)[+] [-] Lib/fileinput.py 2 Lib/test/test_fileinput.py 11 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -328,7 +328,7 @@ class FileInput: if self._filename == '-': self._filename = '' if 'b' in self._mode:

--- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -240,6 +240,17 @@ class FileInputTests(unittest.TestCase): lines = list(fi) self.assertEqual(lines, [b'spam, bacon, sausage, and spam'])

+ def test_file_opening_hook(self): try: # cannot use openhook and inplace mode

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -128,6 +128,9 @@ Core and Builtins Library ------- +- Issue #25447: fileinput now uses sys.stdin as-is if it does not have a