Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

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

ipython opened this issue May 10, 2010 · 15 comments
Labels
Milestone

Comments

@ipython
Copy link
Collaborator

ipython 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

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

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

@ipython
Copy link
Collaborator Author

ipython 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

@ipython
Copy link
Collaborator Author

ipython 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).

@ipython
Copy link
Collaborator Author

ipython 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.

@ipython
Copy link
Collaborator Author

ipython 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
Copy link

xiaket commented Jun 7, 2010

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

@takluyver
Copy link
Member

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

@takluyver
Copy link
Member

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

closed by c709d8b

@takluyver
Copy link
Member

@haosdent
Copy link

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

@takluyver
Copy link
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.

@haosdent
Copy link

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.

@takluyver
Copy link
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
.

@haosdent
Copy link

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

@haosdent
Copy link

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

minrk pushed a commit to minrk/ipython that referenced this issue Jul 1, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants