From: Antoine Pitrou Date: Sat, 16 Aug 2008 23:28:44 +0000 (+0000) Subject: Issue #3571: test_bytes mistakingly closed stdin X-Git-Tag: v3.0b3~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47d305d6891ebc049153086585a3b486cb71a415;p=thirdparty%2FPython%2Fcpython.git Issue #3571: test_bytes mistakingly closed stdin --- diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 230dbf46bed5..c64ac192e5df 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -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"")