diff -r a83f340368c0 Lib/tempfile.py --- a/Lib/tempfile.py Fri Aug 30 16:09:00 2013 +0400 +++ b/Lib/tempfile.py Tue Sep 03 12:51:26 2013 +0400 @@ -242,6 +242,10 @@ except OSError, e: if e.errno == _errno.EEXIST: continue # try again + if _os.name == 'nt' and e.errno == _errno.EACCES: + # On windows, when directory with chosen name already + # exists, EACCES error code is returned instead of EEXIST. + continue raise raise IOError, (_errno.EEXIST, "No usable temporary file name found")