# HG changeset patch # User Mark Determann # Date 1270155870 -3600 # Node ID 5dc09507b90e2e18cf983e70458829e1bd056fed # Parent 278d45703ac26f595e5116ddca45edbb5d5b21a6 hgweb: fix attribute error in error response (issue2060) diff -r 278d45703ac2 -r 5dc09507b90e 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: