Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/chgserver.py @ 30944:48dea083f66d
py3: convert the mode argument of os.fdopen to unicodes (1 of 2)
os.fdopen() does not accepts bytes as its second argument which represent the
mode in which the file is to be opened. This patch makes sure unicodes are
passed in py3 by using pycompat.sysstr().
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 13 Feb 2017 20:06:38 +0530 |
parents | 378686afca52 |
children | cb899ee133d8 |
comparison
equal
deleted
inserted
replaced
30943:78de43ab585f | 30944:48dea083f66d |
---|---|
285 else: | 285 else: |
286 raise error.ProgrammingError('invalid S channel type: %s' % type) | 286 raise error.ProgrammingError('invalid S channel type: %s' % type) |
287 | 287 |
288 _iochannels = [ | 288 _iochannels = [ |
289 # server.ch, ui.fp, mode | 289 # server.ch, ui.fp, mode |
290 ('cin', 'fin', 'rb'), | 290 ('cin', 'fin', pycompat.sysstr('rb')), |
291 ('cout', 'fout', 'wb'), | 291 ('cout', 'fout', pycompat.sysstr('wb')), |
292 ('cerr', 'ferr', 'wb'), | 292 ('cerr', 'ferr', pycompat.sysstr('wb')), |
293 ] | 293 ] |
294 | 294 |
295 class chgcmdserver(commandserver.server): | 295 class chgcmdserver(commandserver.server): |
296 def __init__(self, ui, repo, fin, fout, sock, hashstate, baseaddress): | 296 def __init__(self, ui, repo, fin, fout, sock, hashstate, baseaddress): |
297 super(chgcmdserver, self).__init__( | 297 super(chgcmdserver, self).__init__( |