Mark Lawrence added the comment: 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? ---------- nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22107> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com