bobf is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

bobf / bpython http://bpython-interpreter.org/

Fancy curses interface to the Python interpreter

Clone this repository (size: 838.8 KB): HTTPS / SSH
hg clone https://bitbucket.org/bobf/bpython
hg clone ssh://hg@bitbucket.org/bobf/bpython

Issues

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

Reported anonymously

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')
Status: resolved Responsible: Simon de Vlieger Type: bug Priority: major
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 Anonymous

    written

    Thanks, this issue can also be fixed by setting the env variable LC_ALL. I had every other locale env var set:

    LANG="fi_FI.UTF-8" LC_COLLATE="fi_FI.UTF-8" LC_CTYPE="fi_FI" LC_MESSAGES="fi_FI.UTF-8" LC_MONETARY="fi_FI.UTF-8" LC_NUMERIC="fi_FI.UTF-8" LC_TIME="fi_FI.UTF-8" LC_ALL=

    When I noticed that, I tried: LC_ALL='fi_FI.UTF-8' bpython-2.6

    And it worked!

  2. #2 Simon de Vlieger

    written

    • Changed responsible from nobody to ikanobori.
    • Changed status from new to open.
  3. #3 Simon de Vlieger

    written

    • Changed status from open to resolved.

    Suggestion put in in 405892f014c8

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?