mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
Issue #15261: Stop os.stat(fd) crashing on Windows when fd not open.
This commit is contained in:
parent
74de153681
commit
2240ac1eae
5 changed files with 37 additions and 6 deletions
|
@ -146,6 +146,16 @@ class GenericTest(unittest.TestCase):
|
|||
f.close()
|
||||
support.unlink(support.TESTFN)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_exists_fd(self):
|
||||
r, w = os.pipe()
|
||||
try:
|
||||
self.assertTrue(self.pathmodule.exists(r))
|
||||
finally:
|
||||
os.close(r)
|
||||
os.close(w)
|
||||
self.assertFalse(self.pathmodule.exists(r))
|
||||
|
||||
def test_isdir(self):
|
||||
self.assertIs(self.pathmodule.isdir(support.TESTFN), False)
|
||||
f = open(support.TESTFN, "wb")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue