This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BreamoreBoy
Recipients BreamoreBoy, georg.brandl, ncoghlan, rupole, steve.dower, tim.golden, zach.ware
Date 2015-02-14.22:51:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423954287.63.0.223501496318.issue22107@psf.upfronthosting.co.za>
In-reply-to
Content
changeset 035b61b52caa has this:-

             return (fd, _os.path.abspath(file))
         except FileExistsError:
             continue    # try again
+        except PermissionError:
+            # This exception is thrown when a directory with the chosen name
+            # already exists on windows.
+            if _os.name == 'nt':
+                continue
+            else:
+                raise
 
     raise FileExistsError(_errno.EEXIST,
                           "No usable temporary file name found")

Could we simply set a flag saying it's a PermissionError and then raise the appropriate PermissionError or FileExistsError at the end of the loop?
History
Date User Action Args
2015-02-14 22:51:27BreamoreBoysetrecipients: + BreamoreBoy, georg.brandl, ncoghlan, rupole, tim.golden, zach.ware, steve.dower
2015-02-14 22:51:27BreamoreBoysetmessageid: <1423954287.63.0.223501496318.issue22107@psf.upfronthosting.co.za>
2015-02-14 22:51:27BreamoreBoylinkissue22107 messages
2015-02-14 22:51:27BreamoreBoycreate