repl.py attempts to load a history file using locale.getpreferredencoding().
However, on OS X (10.6, Snow Leopard, US edition), this function returns and empty string on Python 2.5, 2.6, and 2.7. And attempting to load a file with an empty encoding raises an exception.
The following is a quick fix to repl.py, but I don't know if it breaks other platforms:
352c352
< self.rl_history.load(pythonhist, getpreferredencoding())
---
> self.rl_history.load(pythonhist, getpreferredencoding() or 'ascii')
repl.py attempts to load a history file using
locale.getpreferredencoding().However, on OS X (10.6, Snow Leopard, US edition), this function returns and empty string on Python 2.5, 2.6, and 2.7. And attempting to load a file with an empty encoding raises an exception.
The following is a quick fix to repl.py, but I don't know if it breaks other platforms: