summaryrefslogtreecommitdiffstats
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index b5dce97..7154d2c 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -242,6 +242,10 @@ def _mkstemp_inner(dir, pre, suf, flags):
except OSError, e:
if e.errno == _errno.EEXIST:
continue # try again
+ if _os.name == 'nt' and e.errno == _errno.EACCES:
+ # On windows, when a directory with the chosen name already
+ # exists, EACCES error code is returned instead of EEXIST.
+ continue
raise
raise IOError, (_errno.EEXIST, "No usable temporary file name found")