-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
console hangs on 'run' command. #502
Comments
From pierre.raybaut on 2010-12-15T05:56:02Z issue #438 has been merged into this issue. |
From pierre.raybaut on 2010-12-15T10:10:51Z Status: New |
From pierre.raybaut on 2011-03-13T04:35:36Z This issue was closed by revision 970c3cca35 . Status: Fixed |
From christop...@gmail.com on 2011-03-21T02:46:47Z I don't see why issue #438 is related. The hang upon hitting F5 is not fixed here. Spyder 2.1.0dev, Python 2.6.1, Qt 4.6.3, PyQt 4.7.4 on Darwin. Status: Started |
From christop...@gmail.com on 2011-03-24T03:30:13Z ... I found that the console also hangs when pasting text into it. e.g. paste the following into consolex=arange(0,10,0.1) (including newline) and console will hang. |
From ccordoba12 on 2011-03-24T07:28:57Z I can't reproduce this last behavior, nor the first one reported in this bug. I use F5 a lot and I've never seen a console hang. Maybe this is just a Mac related problem (because I work on Linux). I'll try to check on Windows during the weekend. Carlos |
From christop...@gmail.com on 2011-03-24T17:14:22Z Yes, I also think this bug is OS X specific. I have not seen this on Windows. Maybe a bug in QT itself? ... |
From ccordoba12 on 2011-03-24T20:18:11Z Can you see something printed on the internal console before the hang? That could help to solve this mystery :-) |
From Chris.J....@gmail.com on 2011-03-25T05:07:49Z I too have the same issue. Running code from the script in ipython console (and the python console) using 'F5' or 'F9' causes console to hang, as if awaiting more input, but without the '...:' prompt. The cursor just flashes at the far left of the console window, accepting new keyboard input, but displaying no output or prompt of any kind. I have also observed however occasionally, that running an erroneous script does work, well at least keeps the console alive after trying to execute it. Example: open a ipython console and new script with the single line: x() = 20 , and execute with F5 or F9. However this behaviour is not consistent, and quite often also causes the same issue, especially if tried twice in a row on the same console window. Not sure if this helps, but thought I'd report it. I can also verify that the same issue happens when pasting multi-line code into the console window. Single lines of code when copy and pasted in seem to work fine. Also think this bug is Mac specific, as have been using latest version of spyder on windows fine before now. I'm running spyder 2.0.8, on Mac OS X 10.6.6 (Darwin 10.6.0), with: Chris |
From christop...@gmail.com on 2011-03-25T08:52:11Z I have looked into this a little further: the console hangs in the externalshell.pythonshell.execute_lines(), when calling self.emit(SIGNAL("wait_for_ready_read()")). Commenting the line out makes the hang Christoph. |
From ccordoba12 on 2011-03-26T07:24:53Z @-Chris: Thanks for confirming this is a problem that affects all OS X users. @-Chirstoph: Thanks a lot for digging further to solve this problem. This is quite an improvement. The only one that really knows how the IPC protocol works is Pierre, but I'll take a look at it to see if I can find something suspicious. Labels: -Priority-Medium Priority-Critical OpSys-OSX |
From pierre.raybaut on 2011-03-27T07:02:26Z I've tried (and failed) finding an alternative solution to the "wait_for_ready_read()" signal -- which is necessary to wait for the interpreter to be ready for next line execution. It's going to be very difficult to debug knowing that I've currently only access to Linux or Windows machines. But I'll think about it. BTW, I might be wrong but commenting this line should only affect the display: executed lines (inputs) should be printed out together instead of the expected alternate display of inputs/outputs. |
From christop...@gmail.com on 2011-03-28T03:02:06Z I guess you are right regarding commenting that line. That it should In [2]: and then I paste and get: In [3]: In [5]: Notably, the 'In [2]:' prompt turns grey, which indicates to me that it is falsely taken as input. |
From petrus.h...@gmail.com on 2011-04-10T12:58:55Z I experience this on mac osx 10.6 too. One line of "run selected text" works, it pastest into ipython and executes. Next entered line to ipython, regardelss via run selected text or direct entering of command, makes it go into a non-communicative mode. The task clock is still ticking. |
From pierre.raybaut on 2011-04-24T07:38:06Z This issue was closed by revision 970c3cca35f9 . Status: Fixed |
From petrus.h...@gmail.com on 2011-04-24T13:40:43Z The cut-n-paste and run selection issue still seems to be there in mac osx. |
From ccordoba12 on 2011-05-02T07:48:37Z I'm reopening this issue because I don't think the mentioned revision fixed it. It just changes the console encoding and nothing else. Besides, Petrush has confirmed the bug is still present. Status: Accepted |
From ccordoba12 on 2011-05-15T19:40:47Z Labels: Cat-Console |
From Eric.Lub...@gmail.com on 2011-11-21T13:27:09Z Issue still present in OS X 10.7 |
From tomash.k...@seznam.cz on 2011-12-08T09:55:52Z This really unfortunate, the described bug is still there which renders spyder pointless. I used to enjoy working in spyder on Linux and Windows, but now I am stuck having to use Mac... without spyder:( What I care about the most is executing parts of script by F9 (run block/selection). What happens is that no matter the interpreter it does not work after pressing it just two times - first time it executes correctly, second time it either "freezes" (python) or crashes (ipython). There is no information printed to the console, or to the in internal console, that would explain what is going on. If some additional info is needed to debug, or you can provide instructions on how to debug, please ask/tell. OS X 10.6.8 |
From techtonik@gmail.com on 2011-12-09T07:02:38Z You can help to insert relevant debug statements in Spyder code that in --debug mode will provide a sane log for everything that happens after 'Run' action is executed. |
From ccordoba12 on 2011-12-09T08:25:11Z You can see at comment So all people who wants a workaround to this problem, please comment line 62 of file spyderlib/widgets/externalshell/pythonshell.py, which reads like this: self.emit(SIGNAL("wait_for_ready_read()")) and is part of method execute_lines of class ExtPythonShellWidget. Doing this you'll see that text appearing in the console won't preserve indentation and because of that won't look rightly formatted, but it'll be evaluated without problems. In the meantime I'll keep working to find a proper solution Status: Started |
From ccordoba12 on 2011-12-09T13:47:33Z I have now a real patch for this bug: diff -r c6adff9c2b3f spyderlib/widgets/externalshell/pythonshell.py
Please, all interested people try it and tell us if it works for you. We want this to go in the next release. Pierre, I don't understand why the signal hangs the console (it seems that text comes faster from the external process than can be processed by Spyder). Is it equivalent to use time.sleep to bypass this? |
From pierre.raybaut on 2011-12-10T00:08:58Z Carlos, I'm not sure to understand what's going wrong here, but could you try to set a reference to the process in the python shell and call directly the self.process.waitForReadyRead callback instead of doing it through the signal, just in case. So that would be the following, from the current spyderlib/widgets/externalshell/pythonshell.py: In ExternalPythonShell/create_process: replace this:
by this:
and in ExtPythonShellWidget/execute_lines: replace this:
by this:
|
From tomash.k...@seznam.cz on 2011-12-10T05:14:47Z The sleep patch by Carlos soles both the hanging (python) and crashing (ipython) for me. Thanks a lot, this was fast:) I have also tested the changes proposed by Pierre, but these do not solve the bug. Somehow, to me it seems that the call to self.process.waitForReady() is the cause, would it make any sense? |
From pierre.raybaut on 2011-12-10T07:12:13Z That's great news. Let's go for it. It's difficult for me to propose something meaningful for this issue as I don't have the opportunity to work on MacOS and the call to self.process.waitForReady is useful on other platforms -- I don't really understand why it does not work on MacOS, perhaps the implementation of QProcess is slighty different on this platform. |
From ccordoba12 on 2011-12-10T07:25:17Z Thanks Tomash. Not as fast as we'd liked it (the issue was filed a year ago!) but at least it was not as hard as I thought. Pierre, I looked for problems of waitForReadyRead on OS X but found none with QProcess. However I read some people has issues with this method in other classes and use the solution I proposed. I'll push the patch this afternoon so this can go in 2.1.5 |
From Potdevin...@gmail.com on 2011-12-10T15:15:24Z Probably a bit late, but I also would like to confirm that the patch does do the job, with the regular python console as well as ipython. Thanks a lot for that! |
From ccordoba12 on 2011-12-11T09:30:38Z This issue was updated by revision 3f8ce1c6b6c1 . -. Emmiting wait_for_ready_read was making the console hang in OS X. So we just -. It works for python and ipython consoles. Status: Fixed |
From christop...@gmail.com on 2010-12-15T06:47:05Z
What steps will reproduce the problem?
Please provide any additional information below
. if runfile(....) is typed on the console, hang does not occur.
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=502
The text was updated successfully, but these errors were encountered: