upip: MaxOSX mkdir("/") returns EISDIR, and not EEXIST.

Unlike Linux, which return EEXIST. This MacOSX behavior is not documented
in the official documentation:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/mkdir.2.html
(EISDIR isn't described as possible error for mkdir()!), but other projects
had to apply similar workarounds, e.g.:
https://github.com/janestreet/core/issues/7 . The issue appear to happen
only for root directory path, but workaround is applied conservatively
just in case.
pull/54/head
Nico 2015-11-14 20:23:25 +01:00 zatwierdzone przez Paul Sokolovsky
rodzic 4b2d7e91ff
commit cd1fea8798
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -56,7 +56,7 @@ def _makedirs(name, mode=0o777):
os.mkdir(s)
ret = True
except OSError as e:
if e.args[0] != errno.EEXIST:
if e.args[0] != errno.EEXIST and e.args[0] != errno.EISDIR:
raise
ret = False
return ret