Calling os.makedirs(..., exists_ok=True)
on a directory that is not writable raises the wrong exception
#507
Labels
os.makedirs(..., exists_ok=True)
on a directory that is not writable raises the wrong exception
#507
Describe the bug
When using
os.makedirs(..., exists_ok=True)
on a directory that does not have write permissions, the raised exception is not correct.FileNotFoundError
is raised instead of an expectedPermissionError
. This is different from the expected behaviour when using real filesystem APIs.How To Reproduce
pytest will fail stating that
FileNotFoundError
was raised instead ofPermissionError
.Here is a truncated output:
If we attempt to do something similar with the real filesystem, the correct exception is raised and all the tests pass:
Your enviroment
The text was updated successfully, but these errors were encountered: