On Thu, Oct 8, 2009 at 8:18 PM, Xavier de Gaye <[email protected]> wrote:
> On Thu, Oct 8, 2009 at 9:43 AM, Nathan Huesken wrote:
>>
>> When I start pyclewn from the console, everything is fine.
>> But when I start it using dmenu:
>>
>> Exception in pyclewn:
>>
>> -----------
>> <type 'exceptions.OSError'>
>> "[Errno 25] Inappropriate ioctl for device"
>> source line: "f = open(os.ttyname(0), 'rw')"
>> at /usr/lib/python2.6/site-packages/clewn/gdb.py:224
>>
>> pyclewn aborting...
>
> Hello Nathan,
>
> I can reproduce it, thanks for reporting this bug. I will send a fix
> shortly.


The bug "crash when running without console" has been entered in the
tracker as 2875846.

You can fix the bug in pyclewn-0.7 (the latest release) by applying
the attached patch with the following commands:

    tar xzf pyclewn-0.7.tar.gz
    cd pyclewn-0.7
    patch -p1 < /path/to/pyclewn-0.7-noconsole.diff
    python setup.py install


Xavier
diff -r 24a8b8609a47 clewn/gdb.py
--- a/clewn/gdb.py	Sat Apr 18 18:15:52 2009 +0000
+++ b/clewn/gdb.py	Fri Oct 09 20:37:35 2009 +0200
@@ -221,10 +221,15 @@
     # (gdb does the same on forking the debuggee)
     if hasattr(os, 'ttyname'):
         try:
-            f = open(os.ttyname(0), 'rw')
-            f.close()
-        except IOError, err:
-            raise clewn.Error, ("Gdb cannot open the terminal: %s" % err)
+            ttyname = os.ttyname(0)
+        except OSError, err:
+            info('No terminal associated with stdin: %s', err)
+        else:
+            try:
+                f = open(ttyname, 'rw')
+                f.close()
+            except IOError, err:
+                raise ClewnError("Gdb cannot open the terminal: %s" % err)
 
     version = None
     header = gdb_batch(pgm, 'show version')
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pyclewn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyclewn-general

Reply via email to