[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

Daniel Plachotich report at bugs.python.org
Mon Nov 9 18:13:14 EST 2015


Daniel Plachotich added the comment:

You mean msg254341? As I mentioned recently, it still will raise an exception
in case of EROFS, ENOSPC and possibly other values, which, as in the case
with Windows, can be quite unexpected depending on platform and circumstances.

Of course there is no practical sense to continue when, for example, FS is
read-only (EROFS), but I think makedirs must be predictable: it should
first check and only then try to create, as it stated in the docstring.
When exist_ok=True and directory really exists, a user doesn't expect any
exceptions from the internally used mkdir, because it simply shouldn't be
called in this case.

By the way, why 3.2 and 3.3 were removed from the list? exist_ok was introduced in 3.2.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25583>
_______________________________________


More information about the Python-bugs-list mailing list