← 输入框|github.com|刷新
Skip to content

ipython change char '0xe9' to 4 spaces #58

Closed

Description

Original Launchpad bug 328942: https://bugs.launchpad.net/ipython/+bug/328942
Reported by: lidaobing (LI Daobing).

Binary package hint: ipython

How to reproduce:

  1. start a terminal support unicode (such as gnome-terminal or mlterm)
  2. start ipython, then run "print unichr(0x9000)", the output in terminal should like:

In [1]: print unichr(0x9000)
退

  1. copy this character ("退") and paste it to ipython again (after "In [2]:"), then press enter, ipython will quit.

change 0x9000 to 0x8fff, ipython will not crash. change 0x9000 to other number bigger than 0x9000, ipython will also crash (I test many number, but not all, :-)

python don't have this bug.

this bug can be reproduce in gnome-terminal and mlterm.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 8.10
Package: ipython 0.8.4-1
PackageArchitecture: all
ProcEnviron:
PATH=/home/username/.local/bin:/home/username/bin:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ipython
Uname: Linux 2.6.27-7-generic i686

Activity

  1. xiaket commented on Jun 7, 2010

    @xiaket

    I can repeat this bug on a linux box running ipython 0.10. Hope someone would fix it.

  2. takluyver commented on Mar 23, 2011

    @takluyver
    Member

    Interesting. If it helps anyone, the range of characters concerned have the first byte /xe9 in utf-8.

  3. takluyver commented on Mar 23, 2011

    @takluyver
    Member

    Disable readline \M-i, so characters 0x9000-0x9fff don't crash IPython.

    closed by c709d8b

  4. takluyver commented on Mar 26, 2011

    @takluyver
    Member
  5. added a commit that references this issue on Apr 21, 2011
    c709d8b
  6. haosdent commented on Jun 23, 2013

    @haosdent

    Hi, how could I "Disable readline \M-i", the version of my ipython is 0.13.2

  7. takluyver commented on Jun 23, 2013

    @takluyver
    Member

    It should be disabled by default in that version. Check c.TerminalInteractiveShell.readline_parse_and_bind in your ipython_config.py file. You might also want to check your .inputrc file, because IPython can use that as well.

  8. haosdent commented on Jun 23, 2013

    @haosdent

    I couldn't find "c.TerminalInteractiveShell.readline_parse_and_bind" in all "ipython_config.py" files under "/Library/Python/2.7/site-packages/ipython-0.13.2-py2.7.egg/IPython/config/profile". I don't have ".inputrc" file and other ipython profiles in my home folder. But I still couldn't type Chinese in ipython.

  9. takluyver commented on Jun 23, 2013

    @takluyver
    Member

    The config files are in ~/.ipython or ~/.config/ipython, but if they're
    only made if you explicitly create them ('ipython profile create'), so if
    you don't know about them, they're probably not there.

    It might be an issue with your terminal. Mac users, can someone offer
    advice?

    On 23 June 2013 11:27, haosdent notifications@github.com wrote:

    I couldn't find "c.TerminalInteractiveShell.readline_parse_and_bind" in
    all "ipython_config.py" files under
    "/Library/Python/2.7/site-packages/ipython-0.13.2-py2.7.egg/IPython/config/profile".
    I don't have ".inputrc" file and other ipython profiles in my home folder.
    But I still couldn't type Chinese in ipython.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-19871830
    .

  10. haosdent commented on Jun 23, 2013

    @haosdent

    I could type Chinese in termial normally. And I couldn't any profile files in "/.ipython" folder. In mac, "/.config" isn't exist.

  11. haosdent commented on Jun 23, 2013

    @haosdent

    Thank you very much. I found that I could solve this by "export LC_ALL="en_US.UTF-8"".

  12. added a commit that references this issue on Jul 1, 2013
  13. added a commit that references this issue on Nov 3, 2014
    1e671d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions