comparison mercurial/wireprotoserver.py @ 36258:af0a19d8812b

py3: get bytes-repr of network errors portably This resolves a lot of weird issues in Python 3 around error strings. Differential Revision: https://phab.mercurial-scm.org/D2295
author Augie Fackler <augie@google.com>
date Sat, 17 Feb 2018 01:11:48 -0500
parents 72812ad205d1
children 685bcdd236b5
comparison
equal deleted inserted replaced
36257:46c97973ee46 36258:af0a19d8812b
337 else: 337 else:
338 req.headers.append((r'Connection', r'Close')) 338 req.headers.append((r'Connection', r'Close'))
339 339
340 # TODO This response body assumes the failed command was 340 # TODO This response body assumes the failed command was
341 # "unbundle." That assumption is not always valid. 341 # "unbundle." That assumption is not always valid.
342 req.respond(e, HGTYPE, body='0\n%s\n' % e) 342 req.respond(e, HGTYPE, body='0\n%s\n' % pycompat.bytestr(e))
343 343
344 return '' 344 return ''
345 345
346 def _sshv1respondbytes(fout, value): 346 def _sshv1respondbytes(fout, value):
347 """Send a bytes response for protocol version 1.""" 347 """Send a bytes response for protocol version 1."""