Show More
@@ -344,6 +344,12 b' def spawndetached(args):' | |||||
344 | def unlink(f): |
|
344 | def unlink(f): | |
345 | '''try to implement POSIX' unlink semantics on Windows''' |
|
345 | '''try to implement POSIX' unlink semantics on Windows''' | |
346 |
|
346 | |||
|
347 | if os.path.isdir(f): | |||
|
348 | # use EPERM because it is POSIX prescribed value, even though | |||
|
349 | # unlink(2) on directories returns EISDIR on Linux | |||
|
350 | raise IOError(errno.EPERM, | |||
|
351 | "Unlinking directory not permitted: '%s'" % f) | |||
|
352 | ||||
347 | # POSIX allows to unlink and rename open files. Windows has serious |
|
353 | # POSIX allows to unlink and rename open files. Windows has serious | |
348 | # problems with doing that: |
|
354 | # problems with doing that: | |
349 | # - Calling os.unlink (or os.rename) on a file f fails if f or any |
|
355 | # - Calling os.unlink (or os.rename) on a file f fails if f or any |
General Comments 0
You need to be logged in to leave comments.
Login now