Skip to content

Commit df61f31

Browse files
committed
Fix bug #132 by assuming ascii when getpreferredencoding() returns an empty string. This is better than breaking always.
1 parent 8b3941d commit df61f31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/repl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ def __init__(self, interp, config):
401401

402402
pythonhist = os.path.expanduser(self.config.hist_file)
403403
if os.path.exists(pythonhist):
404-
self.rl_history.load(pythonhist, getpreferredencoding())
404+
self.rl_history.load(pythonhist,
405+
getpreferredencoding() or "ascii")
405406

406407
def startup(self):
407408
"""

0 commit comments

Comments
 (0)