We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdb8343 commit b239067Copy full SHA for b239067
bpython/cli.py
@@ -543,7 +543,13 @@ def get_key(self):
543
while True:
544
try:
545
key += self.scr.getkey()
546
- if not py3:
+ if py3:
547
+ # Seems like we get a in the locale's encoding
548
+ # encoded string in Python 3 as well, but of
549
+ # type str instead of bytes, hence convert it to
550
+ # bytes first and decode then
551
+ key = key.encode('latin-1').decode(getpreferredencoding())
552
+ else:
553
key = key.decode(getpreferredencoding())
554
self.scr.nodelay(False)
555
except UnicodeDecodeError:
0 commit comments