From: Victor Stinner Date: Mon, 28 Jul 2014 20:07:07 +0000 (+0200) Subject: Fix test_bytes when sys.stdin is None, for example on Windows when using X-Git-Tag: v3.4.2rc1~177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7611964b2cb82e38f3354e665bbe6c9e7efa8cb6;p=python Fix test_bytes when sys.stdin is None, for example on Windows when using pythonw.exe instead of python.exe --- diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index f350211f71..43b6c824a8 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -700,7 +700,7 @@ class BytesTest(BaseBytesTest, unittest.TestCase): type2test = bytes def test_buffer_is_readonly(self): - fd = os.dup(sys.stdin.fileno()) + fd = os.open(__file__, os.O_RDONLY) with open(fd, "rb", buffering=0) as f: self.assertRaises(TypeError, f.readinto, b"")