mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
mapped to POSIX errno ENOTDIR (previously EINVAL).
This commit is contained in:
parent
222b20844f
commit
a762285831
4 changed files with 27 additions and 6 deletions
|
@ -5,6 +5,7 @@ import sys
|
|||
import unittest
|
||||
import pickle
|
||||
import weakref
|
||||
import errno
|
||||
|
||||
from test.support import (TESTFN, unlink, run_unittest, captured_output,
|
||||
gc_collect, cpython_only)
|
||||
|
@ -849,6 +850,13 @@ class ExceptionTests(unittest.TestCase):
|
|||
self.fail("RuntimeError not raised")
|
||||
self.assertEqual(wr(), None)
|
||||
|
||||
def test_errno_ENOTDIR(self):
|
||||
# Issue #12802: "not a directory" errors are ENOTDIR even on Windows
|
||||
with self.assertRaises(OSError) as cm:
|
||||
os.listdir(__file__)
|
||||
self.assertEqual(cm.exception.errno, errno.ENOTDIR, cm.exception)
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(ExceptionTests)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue