hgweb: fix attribute error in error response (issue2060) stable
authorMark Determann <qwerty360@gmail.com>
Thu, 01 Apr 2010 22:04:30 +0100
branchstable
changeset 10951 5dc09507b90e
parent 10950 278d45703ac2
child 10952 6c2c766afefe
hgweb: fix attribute error in error response (issue2060)
mercurial/hgweb/protocol.py
--- a/mercurial/hgweb/protocol.py	Thu Mar 04 14:32:01 2010 -0600
+++ b/mercurial/hgweb/protocol.py	Thu Apr 01 22:04:30 2010 +0100
@@ -179,6 +179,8 @@
             raise ErrorResponse(HTTP_OK, inst)
         except (OSError, IOError), inst:
             error = getattr(inst, 'strerror', 'Unknown error')
+            if not isinstance(error, str):
+                error = 'Error: %s' % str(error)
             if inst.errno == errno.ENOENT:
                 code = HTTP_NOT_FOUND
             else: