mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) (#805)
when the OS gives priority to errors such as EACCES over EEXIST.
This commit is contained in:
parent
8988945cdc
commit
af7b9ec5c8
3 changed files with 23 additions and 17 deletions
|
@ -1776,6 +1776,11 @@ class _BasePathTest(object):
|
|||
self.assertTrue(p.exists())
|
||||
self.assertEqual(p.stat().st_ctime, st_ctime_first)
|
||||
|
||||
def test_mkdir_exist_ok_root(self):
|
||||
# Issue #25803: A drive root could raise PermissionError on Windows
|
||||
self.cls('/').resolve().mkdir(exist_ok=True)
|
||||
self.cls('/').resolve().mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@only_nt # XXX: not sure how to test this on POSIX
|
||||
def test_mkdir_with_unknown_drive(self):
|
||||
for d in 'ZYXWVUTSRQPONMLKJIHGFEDCBA':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue