diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-04 20:53:29 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-04 20:53:29 (GMT) |
commit | 0049249d63a067aaffbbf3172a6e8cd8c956b643 (patch) | |
tree | dcfee8a6bd6e16db18121380d565bdf8278d9ee6 /Lib/test/test_fileio.py | |
parent | 7d6e076f6d8dd48cfd748b02dad17dbeb0b346a3 (diff) | |
download | cpython-0049249d63a067aaffbbf3172a6e8cd8c956b643.zip cpython-0049249d63a067aaffbbf3172a6e8cd8c956b643.tar.gz cpython-0049249d63a067aaffbbf3172a6e8cd8c956b643.tar.bz2 |
Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
descriptor is provided. Patch by Pascal Chambon.
Diffstat (limited to 'Lib/test/test_fileio.py')
-rw-r--r-- | Lib/test/test_fileio.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 63bc1d9..4b48d41 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -309,6 +309,9 @@ class OtherFileTests(unittest.TestCase): def testInvalidFd(self): self.assertRaises(ValueError, _FileIO, -10) self.assertRaises(OSError, _FileIO, make_bad_fd()) + if sys.platform == 'win32': + import msvcrt + self.assertRaises(IOError, msvcrt.get_osfhandle, make_bad_fd()) def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument |