mercurial/ui.py
changeset 43118 57efd5bd2ca2
parent 43106 d783f945a701
child 43265 82879e06c926
equal deleted inserted replaced
43117:8ff1ecfadcd1 43118:57efd5bd2ca2
  1553 
  1553 
  1554         # prompt ' ' must exist; otherwise readline may delete entire line
  1554         # prompt ' ' must exist; otherwise readline may delete entire line
  1555         # - http://bugs.python.org/issue12833
  1555         # - http://bugs.python.org/issue12833
  1556         with self.timeblockedsection(b'stdio'):
  1556         with self.timeblockedsection(b'stdio'):
  1557             if usereadline:
  1557             if usereadline:
       
  1558                 prompt = encoding.strfromlocal(prompt)
  1558                 line = encoding.strtolocal(pycompat.rawinput(prompt))
  1559                 line = encoding.strtolocal(pycompat.rawinput(prompt))
  1559                 # When stdin is in binary mode on Windows, it can cause
  1560                 # When stdin is in binary mode on Windows, it can cause
  1560                 # raw_input() to emit an extra trailing carriage return
  1561                 # raw_input() to emit an extra trailing carriage return
  1561                 if pycompat.oslinesep == b'\r\n' and line.endswith(b'\r'):
  1562                 if pycompat.oslinesep == b'\r\n' and line.endswith(b'\r'):
  1562                     line = line[:-1]
  1563                     line = line[:-1]