mercurial/hgweb/common.py
changeset 34022 d5b2beca16c0
parent 31790 62f9679df1f2
child 34511 67873ec0f4ce
equal deleted inserted replaced
34021:31a2eb0f74e5 34022:d5b2beca16c0
   176         raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename')
   176         raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename')
   177     except OSError as err:
   177     except OSError as err:
   178         if err.errno == errno.ENOENT:
   178         if err.errno == errno.ENOENT:
   179             raise ErrorResponse(HTTP_NOT_FOUND)
   179             raise ErrorResponse(HTTP_NOT_FOUND)
   180         else:
   180         else:
   181             raise ErrorResponse(HTTP_SERVER_ERROR, err.strerror)
   181             raise ErrorResponse(HTTP_SERVER_ERROR,
       
   182                                 encoding.strtolocal(err.strerror))
   182 
   183 
   183 def paritygen(stripecount, offset=0):
   184 def paritygen(stripecount, offset=0):
   184     """count parity of horizontal stripes for easier reading"""
   185     """count parity of horizontal stripes for easier reading"""
   185     if stripecount and offset:
   186     if stripecount and offset:
   186         # account for offset, e.g. due to building the list in reverse
   187         # account for offset, e.g. due to building the list in reverse