[Twisted-Python] Re: [Twisted-commits] r18104 - Some systems raise an OSError with EPERM rather than an IOError with EACCES for filesystem permissions errors.

Jean-Paul Calderone exarkun at divmod.com
Tue Sep 12 16:10:38 MDT 2006


On Tue, 12 Sep 2006 16:09:33 -0600, Wilfredo Sanchez <wsanchez at wolfwood.twistedmatrix.com> wrote:
>Author: wsanchez
>Date: Tue Sep 12 16:09:31 2006
>New Revision: 18104
>
>Modified:
>   trunk/twisted/web2/dav/http.py
>Log:
>Some systems raise an OSError with EPERM rather than an IOError with EACCES for filesystem permissions errors.
>Submitted by rfmohr at osc.edu
>Reviewed by wsanchez
>Fixes #1807
>
>
>Modified: trunk/twisted/web2/dav/http.py
>==============================================================================
>--- trunk/twisted/web2/dav/http.py	(original)
>+++ trunk/twisted/web2/dav/http.py	Tue Sep 12 16:09:31 2006
>@@ -262,9 +262,9 @@
>         if what is not None:
>             log.msg("%s while %s" % (err, what))
>
>-    if failure.check(IOError):
>+    if failure.check(IOError, OSError):
>         e = failure.value[0]
>-        if e == errno.EACCES:
>+        if e == errno.EACCES or e == errno.EPERM:
>             msg("Permission denied")
>             return responsecode.FORBIDDEN
>         elif e == errno.ENOSPC:
>

Tests?

Jean-Paul





More information about the Twisted-Python mailing list