mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +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:
		
						commit
						5edbaf295e
					
				
					 4 changed files with 27 additions and 6 deletions
				
			
		|  | @ -5,6 +5,7 @@ | |||
| import unittest | ||||
| import pickle | ||||
| import weakref | ||||
| import errno | ||||
| 
 | ||||
| from test.support import (TESTFN, unlink, run_unittest, captured_output, | ||||
|                           gc_collect, cpython_only, no_tracing) | ||||
|  | @ -852,6 +853,13 @@ def inner(): | |||
|             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
	
	 Antoine Pitrou
						Antoine Pitrou