Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
ipython opened this Issue May 10, 2010 · 15 comments

Comments

Projects
None yet
4 participants
@ghost

ghost commented May 10, 2010

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

@ghost

ghost commented May 10, 2010

[ LP comment 1 by: LI Daobing, on 2009-02-13 07:24:47.971268+00:00 ]

@ghost

ghost commented May 10, 2010

[ LP comment 2 by: LI Daobing, on 2009-02-13 07:48:43.619610+00:00 ]

this bug also exist in ipython 0.9.1

@ghost

ghost commented May 10, 2010

[ LP comment 3 by: Fernando Perez, on 2009-03-14 13:01:17.900891+00:00 ]

At least on my trunk, it looks fine:

uqbar[scratch]> python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

print unichr(0x9000)
退

uqbar[scratch]> ip -nobanner

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

Closing for now, reopen if you have further info using my trunk:
https://code.launchpad.net/~fdo.perez/ipython/trunk-dev

(this will be soon merged for release, once it's reviewed by others).

@ghost

ghost commented May 10, 2010

[ LP comment 4 by: LI Daobing, on 2009-03-14 17:58:54.631789+00:00 ]

another way to reproduce this bug

  1. change your terminal encoding to ISO8859-1
  2. change your locale to en_US.ISO8859-1
  3. run ipython
  4. input or paste "é" (0xe9 in iso8859-1) to your ipython interactive line, then you will find it have been change to 4 spaces " "
  5. the nearby character do not have this bug: for example: è (0xe8), or ê(0xea)

thanks.

@ghost

ghost commented May 10, 2010

[ LP comment 5 by: Fernando Perez, on 2009-03-15 22:58:02.269438+00:00 ]

OK, I see it now. In fact, I don't even have to change my locale, just the terminal encoding (at least on gnome-terminal).

I'm marking it as confirmed but assigned to nobody, because honestly I don't know how to fix it right now, and I have other things on my plate that are more urgent for me. We have others on the team that know much, much more about unicode than I do, so perhaps one of them can help. And if you do find a solution, please send it in, it would be very nice to have this fixed.

Sorry not to be able to help more right now.

xiaket commented Jun 7, 2010

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

Owner

takluyver commented Mar 23, 2011

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

Owner

takluyver commented Mar 23, 2011

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

closed by c709d8b

@takluyver takluyver closed this Mar 23, 2011

@markvoorhies markvoorhies pushed a commit to markvoorhies/ipython that referenced this issue Apr 21, 2011

@takluyver takluyver Disable readline \M-i, so characters 0x9000-0x9fff don't crash IPython.
closes gh-58
c709d8b

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

Owner

takluyver commented Jun 23, 2013

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.

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.

Owner

takluyver commented Jun 23, 2013

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/ipython/ipython/issues/58#issuecomment-19871830
.

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

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

@minrk minrk pushed a commit to minrk/ipython that referenced this issue Jul 1, 2013

@Carreau Carreau Merge pull request #58 from maxalbert/test_cleanup_and_bugfix
Test cleanup and bugfix
f979e87

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

@takluyver takluyver Disable readline \M-i, so characters 0x9000-0x9fff don't crash IPython.
closes gh-58
1e671d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment