]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #3571: test_bytes mistakingly closed stdin
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 16 Aug 2008 23:28:44 +0000 (23:28 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 16 Aug 2008 23:28:44 +0000 (23:28 +0000)
Lib/test/test_bytes.py

index 230dbf46bed58aca75738bdb8e2ccae787cfae0b..c64ac192e5df56514b17cd0d5c1dfd5203004ab3 100644 (file)
@@ -454,7 +454,8 @@ class BytesTest(BaseBytesTest):
     type2test = bytes
 
     def test_buffer_is_readonly(self):
-        with open(sys.stdin.fileno(), "rb", buffering=0) as f:
+        fd = os.dup(sys.stdin.fileno())
+        with open(fd, "rb", buffering=0) as f:
             self.assertRaises(TypeError, f.readinto, b"")