Skip to content

History file broken on OS X (encoding problem) #132

@ikanobori

Description

@ikanobori

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions