changeset 10951:5dc09507b90e stable

hgweb: fix attribute error in error response (issue2060)
author Mark Determann <qwerty360@gmail.com>
date Thu, 01 Apr 2010 22:04:30 +0100
parents 278d45703ac2
children 6c2c766afefe
files mercurial/hgweb/protocol.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: