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 crashes on ctrl-c #2188

Closed
jchayat opened this issue Jul 22, 2012 · 5 comments
Closed

ipython crashes on ctrl-c #2188

jchayat opened this issue Jul 22, 2012 · 5 comments

Comments

@jchayat
Copy link

jchayat commented Jul 22, 2012

Hi all,

I'm using Ipython (0.12 or 0.13 - same problem) under bash in Ubuntu 12.04 Desktop 64-bit.

I'm trying to use neo4j-embedded (a version of neo4j graph database that's embedded in python), It uses jpype.
after I import neo4j, if i press UP (for line history) and then crtl-c to clear the line then Ipython crashes in a wierd way.
It returns to console but text is not displayed anymore (but it is still possible to execute commands - text just not displayed).
also ENTER stops breaking the line, it just causes the prompt to be reprinted (at the end of the line)

this happens only after I import neo4j, but I still post it here in ipython since it is a shell issue,

Jon

@fperez
Copy link
Member

fperez commented Jul 24, 2012

Does this also happen if you do it in nomal python (not ipython), but where you first run import rlcompleter? That would help us know if it's a readline interaction or not.

Also, can you test if it happens when using the qtconsole or the notebook?

@jbruck
Copy link

jbruck commented Aug 23, 2012

I have a similar issue. I'm on Windows 7 32bit, I installed python xy, but have subsequently upgraded to ipython 0.13

Ipython crashes when I press ctrl_c from the command prompt (and in windows powershell).

Standard python does not crash on import rlcompleter and the qtconsole and notebook do not crash either.

@takluyver
Copy link
Member

@jbruck : My instinct is that that's a different problem - you're on a different platform and you don't mention using neo4j. Can you file a separate issue for it, with a copy of any error message or traceback you get?

@shawnlower
Copy link

Yes, I'm having the same issue here, and it affects both iPython (0.12.1) and CPython (2.7.3-0ubuntu3.1).

I suppose that means I should be reporting the bug with neo4j?

I was able to workaround it by restoring the signal handler after importing neo4j. Example:

#########################################################################

Crashy behavior:

shawn@carbon:~/Download/neo4j-community-1.8$ ipython

In [1]: from neo4j import GraphDatabase

In [2]: shawn@carbon:~/Download/neo4j-community-1.8$ 130
shawn@carbon:~/Download/neo4j-community-1.8$ shawn@carbon:~/Download/neo4j-community-1.8$ 
shawn@carbon:~/Download/neo4j-community-1.8$ 

#########################################################################

Control-C was pressed at [2]. Afterward I ran 'echo $?', to show the return code of 130, and 'stty echo' to fix the terminal ('reset' would also work).

#########################################################################

With rlcompleter:

shawn@carbon:~/Download/neo4j-community-1.8$ python
Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rlcompleter
>>> from neo4j import GraphDatabase
>>> shawn@carbon:~/Download/neo4j-community-1.8$ 

#########################################################################

Fixed behavior:

shawn@carbon:~/Download/neo4j-community-1.8$ ipython

In [1]: from neo4j import GraphDatabase

In [2]: import signal

In [3]: signal.signal(signal.SIGINT, signal.default_int_handler)
Out[3]: <function signal.default_int_handler>

In [4]: 
KeyboardInterrupt

In [4]: 

#########################################################################

For reference, here are a few of the other package versions:

  • neo4j-community-1.8
  • JPype==0.5.4.2 (via pip)
  • openjdk-6-jre-headless 6b24-1.11.4-1ubuntu0.12.04.1 i386

@minrk
Copy link
Member

minrk commented Jan 20, 2013

From my reading, this is a neo4j issue, registering a signal handler. IPython should probably not protect against this sort of thing.

@minrk minrk closed this as completed Jan 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants