Message243812
Ok, I think I understand now. You chose an indirect check to avoid the race condition. If we have write access to the directory, then the PermissionError must be because a directory exists with the same name.
Unfortunately os.access doesn't currently tell us this information. Moreover, checking `isdir(dir) and access(dir, W_OK)` is actually redundant as things currently stand. If `isdir` returns True that means GetFileAttributes didn't fail, which means `access` must return True as designed:
return_value = (attr != INVALID_FILE_ATTRIBUTES) &&
( !(mode & 2) ||
!(attr & FILE_ATTRIBUTE_READONLY) ||
(attr & FILE_ATTRIBUTE_DIRECTORY) ); |
|
Date |
User |
Action |
Args |
2015-05-22 06:58:55 | eryksun | set | recipients:
+ eryksun, georg.brandl, paul.moore, ncoghlan, rupole, tim.golden, BreamoreBoy, python-dev, zach.ware, serhiy.storchaka, steve.dower |
2015-05-22 06:58:55 | eryksun | set | messageid: <1432277935.48.0.352888068847.issue22107@psf.upfronthosting.co.za> |
2015-05-22 06:58:55 | eryksun | link | issue22107 messages |
2015-05-22 06:58:55 | eryksun | create | |
|