mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
descriptor is provided. Patch by Pascal Chambon.
This commit is contained in:
parent
7d6e076f6d
commit
0049249d63
3 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue