Daniel Plachotich added the comment:
Looks good to me.
Without the fix, the test fails on Windows 7 as expected.
--
___
Python tracker
<http://bugs.python.org/issue25
Daniel Plachotich added the comment:
Yes, it's probably a better solution. If had been more careful, I wouldn't have
scribbled so much text here :) .
But is there any sense in adding Windows-specific test with EACCES since the
problem with errno may affect other platforms as well (a
Daniel Plachotich added the comment:
You mean msg254341? As I mentioned recently, it still will raise an exception
in case of EROFS, ENOSPC and possibly other values, which, as in the case
with Windows, can be quite unexpected depending on platform and circumstances.
Of course there is no
Daniel Plachotich added the comment:
Maybe the solution is to leave OSError catching after the conditional
(probably with some additional comments):
if not (exist_ok and path.isdir(name)):
try:
mkdir(name, mode)
except OSError as e:
if not exist_ok or e.errno
Daniel Plachotich added the comment:
Of course, exist_ok must be taken into account:
if not (exist_ok and path.isdir(name)):
mkdir(name, mode)
--
___
Python tracker
<http://bugs.python.org/issue25
Daniel Plachotich added the comment:
I meant x1.3 times faster on Linux :)
--
___
Python tracker
<http://bugs.python.org/issue25583>
___
___
Python-bugs-list m
Daniel Plachotich added the comment:
Of course in examples I create '.' by hand, but in real code such things are
mostly automatic. Assume, for example, that you have a function for downloading
files:
def download_file(url, save_as):
...
# Before saving, you must ensure that p
Daniel Plachotich added the comment:
Probably better solution:
if not (exist_ok and path.isdir(name) and
e.errno in (errno.EEXIST, errno.EACCES)):
--
___
Python tracker
<http://bugs.python.org/issue25
New submission from Daniel Plachotich:
Since Windows 7 (or even Vista), Windows gives permission error(5,
ERROR_ACCESS_DENIED
if you try to create a directory in a drive root with the same name as a drive
itself,
even if you have administrative permissions. This behavior is not mentioned in