[issue22107] tempfile module misinterprets access denied error on Windows
Thomas Kluyver
report at bugs.python.org
Thu Feb 4 07:48:54 EST 2016
Thomas Kluyver added the comment:
This issue was closed, but I believe the original bug reported was not fixed: trying to create a temporary file in a directory where you don't have write permissions hangs for a long time before failing with a misleading FileExistsError, rather than failing immediately with PermissionError.
I've just run into this on Python 3.5.1 while trying to use tempfile to check if a directory is writable - which I'm doing precisely because os.access() isn't useful on Windows!
I find it hard to believe that there is no way to distinguish a failure because the name is already used for a subdirectory from a failure because we don't have permission to create a file.
----------
nosy: +takluyver
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22107>
_______________________________________
More information about the Python-bugs-list
mailing list