Message243805
Shouldn't it be checking whether `file` (or `filename`) is a directory [1]? For example:
except PermissionError:
# This exception is thrown when a directory with
# the chosen name already exists on windows.
if _os.name == 'nt' and _os.path.isdir(file):
continue
# If the directory allows write access, continue
# trying names. On Windows, currently this test
# doesn't work. The implementation assumes all
# directories allow write access, but it really
# depends on the directory's discretionary and
# system access control lists (DACL & SACL).
elif _os.access(dir, _os.W_OK):
continue
else:
raise
---
[1]: Windows sets the last error to ERROR_ACCESS_DENIED when a system
call returns the NTSTATUS code STATUS_FILE_IS_A_DIRECTORY. This
status code is returned by NtCreateFile and NtOpenFile when the
target file is a directory, but the caller asked for anything
but a directory (i.e. CreateOptions contains
FILE_NON_DIRECTORY_FILE). |
|
Date |
User |
Action |
Args |
2015-05-22 04:22:37 | eryksun | set | recipients:
+ eryksun, georg.brandl, paul.moore, ncoghlan, rupole, tim.golden, BreamoreBoy, python-dev, zach.ware, serhiy.storchaka, steve.dower |
2015-05-22 04:22:37 | eryksun | set | messageid: <1432268557.03.0.564375193324.issue22107@psf.upfronthosting.co.za> |
2015-05-22 04:22:37 | eryksun | link | issue22107 messages |
2015-05-22 04:22:36 | eryksun | create | |
|