thegooglecodearchive / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 1 forks source link

sys.exit() call through PyShell freezes Editra #220

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What Plugin does this relate to?
PyShell

What version of the Plugin?
0.8

What steps will reproduce the problem?
1. Open a PyShell shelf
2. Write the following code:

>>> import sys
>>> sys.exit() # It fails even if you use an exit code like 0, 16, 100

3. Editra freezes

What is the expected output?
Nothing. Just restart PyShell

What do you see instead?
The system asking me to close the application

What version of Editra are you using?
0.7.12

On what operating system?
Ubuntu x64 with KDE 4.6.5

Please provide any additional information below
Python version(s): 2.6.6/2.7.1

Original issue reported on code.google.com by zorobabe...@gmail.com on 21 Sep 2012 at 9:41

GoogleCodeExporter commented 9 years ago
I suggest that PyCrust could be an excellent replacement. This does not fail in 
it.

Original comment by zorobabe...@gmail.com on 25 Sep 2012 at 5:37

GoogleCodeExporter commented 9 years ago
PyCrust is just PyShell with some extra panels attached to it. It will fail the 
same way.

The problem is that the shell is running in the same instance of Python as 
Editra is running in so if you call sys.exit() it will cause problems in 
Editra. The PyShell plugin should only be used for very simple things.

Original comment by CodyPrec...@gmail.com on 26 Sep 2012 at 12:42

GoogleCodeExporter commented 9 years ago
But this function call is so simple

Original comment by zorobabe...@gmail.com on 26 Sep 2012 at 2:12

GoogleCodeExporter commented 9 years ago
You're right. Although there are clueless that this can ruin their work, worse 
if they not saved their files

Original comment by zorobabe...@gmail.com on 26 Sep 2012 at 2:43

GoogleCodeExporter commented 9 years ago
Yes this is a known issue. The only real fix is to have a separate python 
process running that does the actual excution of the code in the shell window. 
Not sure on how soon I will be able to look into this so any patches by 
interested parties to improve this plugin would be appreciated.

In the meantime the PyShell window should only really be used for testing minor 
things. If you are trying to run whole scripts then would suggest to use the 
Launch plugin as thats what its built for. Edit your script in the edit window 
and use F5 to execute it in Launch.

Original comment by CodyPrec...@gmail.com on 26 Sep 2012 at 3:23

GoogleCodeExporter commented 9 years ago
c00l

Original comment by hutchiso...@gmail.com on 21 Mar 2013 at 12:04