kopia lustrzana https://github.com/micropython/micropython-lib
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
rodzic
4b2d7e91ff
commit
cd1fea8798
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue