Here is a quick fix that solved the problem for me. 

I attached the diff files for spyderlib/spyder.py and 
spyderlib/widgets/externalshell/introspection.py

Cheers,

Sylvain

On Monday, February 18, 2013 4:08:22 PM UTC-5, Sylvain Corlay wrote:
>
> I tried to debug it but the bug does not occur when debugging and ipython 
> consoles are correctly opened. 
> S. 
>
> On Monday, February 18, 2013 3:51:56 PM UTC-5, Sylvain Corlay wrote:
>>
>> Everything in 64 bits
>>
>> ipython 0.13.1, (from ppa https://launchpad.net/~jtaylor/+archive/ipython
>> )
>> pyflakes 0.5.0, 
>> rope 0.9.2, 
>> python 2.7.3, 
>> qt 4.8.1
>> python-qt4 4.9.1
>>
>> S. 
>>
>> On Monday, February 18, 2013 1:47:00 PM UTC-5, ufechner wrote:
>>>
>>>  Hi, 
>>>
>>> I cannot reproduce this problem on Ubuntu 12.04, 32 bits.
>>>
>>> I am using revision dd4a10611038, beta2, pyflakes 0.6.1, rope 0.9.4
>>> Python 2.7.3 32 bits, Qt 4.8.1, PyQt4 (API v2) 4.9.1.
>>>
>>> Everything is working fine, only that I still see a double prompt when
>>> debugging with the toolbar, but that is another little problem.
>>>
>>> I am using the following script to launch spyder:
>>>
>>> LD_LIBRARY_PATH='/usr/lib/atlas-base/'
>>> export 
>>> PYTHONPATH=$PYTHONPATH:/home/ufechner/00Software/spyder-2.2/spyderlib
>>> python /home/ufechner/00Software/spyder-2.2/spyderlib/spyderlib/spyder.py
>>>
>>> I forgot to mention that I am using ipython version 0.13.1, installed
>>> with easy_install -U ipython.
>>>
>>>
>>> Best regards:
>>>
>>> Uwe Fechner
>>>
>>> Am 18.02.2013 17:35, schrieb Sylvain Corlay:
>>>  
>>> Hi,  
>>>
>>> It seems that under Ubuntu 12.04 64 bits, spyder fails to open new 
>>> IPython consoles. It does start a new kernel in the "Console" widget but no 
>>> console is opened in the "IPython Console" widget. However, I can still use 
>>> a "connect to an existing kernel" to connect to it. A traceback is produced 
>>> in the internal console: 
>>>
>>>  Exception in thread Thread-2:
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
>>>>     self.run()
>>>>   File "spyderlib/spyderlib/widgets/externalshell/introspection.py", 
>>>> line 62, in run
>>>>     conn, _addr = sock.accept()
>>>>   File "/usr/lib/python2.7/socket.py", line 202, in accept
>>>>     sock, addr = self._sock.accept()
>>>> error: [Errno 4] Interrupted system call
>>>>
>>>>  Exception in thread Thread-3:
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
>>>>     self.run()
>>>>   File "spyderlib/spyderlib/widgets/externalshell/introspection.py", 
>>>> line 62, in run
>>>>     conn, _addr = sock.accept()
>>>>   File "/usr/lib/python2.7/socket.py", line 202, in accept
>>>>     sock, addr = self._sock.accept()
>>>> error: [Errno 4] Interrupted system call
>>>>
>>>>  Exception in thread Thread-4:
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
>>>>     self.run()
>>>>   File "/usr/lib/python2.7/threading.py", line 504, in run
>>>>     self.__target(*self.__args, **self.__kwargs)
>>>>   File "spyderlib/spyderlib/spyder.py", line 1856, in 
>>>> start_open_files_server
>>>>     req, addr = self.open_files_server.accept()
>>>>   File "/usr/lib/python2.7/socket.py", line 202, in accept
>>>>     sock, addr = self._sock.accept()
>>>> error: [Errno 4] Interrupted system call
>>>>
>>>
>>>
>>> (When trying revisions older than *4a06c308b99d (Fixed crash at startup 
>>> occuring when restoring Project Explorer's tree 
>>> view<http://code.google.com/p/spyderlib/source/detail?r=4a06c308b99dbb8d599cb9e331399e04394dcd70>
>>> ), *spyder crashes at startup. However I did not have this issue 
>>> before. I can avoid this problem by deleting the configuration folder 
>>> .spyder2 that does not seem to work with older versions. )
>>>  
>>>  It is odd because I did not have this ipython console issue in the 
>>> past with the corresponding revisions. Although there has been a few 
>>> packages updated in the meanwhile. 
>>>  
>>>  Thanks, 
>>>  
>>>  S. 
>>>
>>>  
>>>  
>>>  
>>>  
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "spyder" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/spyderlib?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>>
>>>  

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


diff -r 20e74405d8cc spyderlib/widgets/externalshell/introspection.py
--- a/spyderlib/widgets/externalshell/introspection.py	Mon Feb 18 09:03:26 2013 -0500
+++ b/spyderlib/widgets/externalshell/introspection.py	Mon Feb 18 16:48:34 2013 -0500
@@ -54,17 +54,21 @@ class IntrospectionServer(threading.Thre
     def run(self):
         """Start server"""
         sock = socket.socket(socket.AF_INET)
         sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         sock.bind( ("127.0.0.1", self.port) )
         
         while True:
             sock.listen(2)
-            conn, _addr = sock.accept()
+            try:
+                conn, _addr = sock.accept()
+            except Exception as e:
+                if e.args[0] == 4:
+                    continue
             shell_id = read_packet(conn)
             if shell_id is not None:
                 self.send_socket(shell_id, conn)
 
 class NotificationServer(IntrospectionServer):
     """Notification server"""
     def __init__(self):
         IntrospectionServer.__init__(self)
diff -r 20e74405d8cc spyderlib/spyder.py
--- a/spyderlib/spyder.py	Mon Feb 18 09:03:26 2013 -0500
+++ b/spyderlib/spyder.py	Mon Feb 18 16:47:52 2013 -0500
@@ -1847,18 +1847,22 @@ Please provide any additional informatio
                                                socket.SOCK_STREAM,
                                                socket.IPPROTO_TCP)
         self.open_files_server.setsockopt(socket.SOL_SOCKET,
                                           socket.SO_REUSEADDR, 1)
         port = select_port(default_port=OPEN_FILES_PORT)
         CONF.set('main', 'open_files_port', port)
         self.open_files_server.bind(('127.0.0.1', port))
         self.open_files_server.listen(20)
-        while 1:
-            req, addr = self.open_files_server.accept()
+        while True:
+            try:
+                req, dummy = self.open_files_server.accept()
+            except Exception as e:
+                if e.args[0] == 4:
+                    continue
             fname = req.recv(1024)
             if not self.light:
                 self.emit(SIGNAL('open_external_file(QString)'), fname)
             req.sendall(' ')
 
         
 def initialize():
     """Initialize Qt, patching sys.exit and eventually setting up ETS"""

Reply via email to