Python app. Eroaster and "output = pipe[0].readlines()" trouble

Ignacio Vazquez-Abrams ignacio at openservices.net
Tue Oct 16 16:28:54 EDT 2001


On Tue, 16 Oct 2001, Kevin wrote:

> I'm having a new trouble with a python application called Eroaster.
> The error message I get is:
>
>       File "/usr/lib/python2.0/site-packages/gtk.py", line 125, in __call__
> 	ret = apply(self.func, a)
>       File "/usr/lib/eroaster/main.py", line 1468, in DetectRecorder
> 	self.DetectSCSIDevice(deviceRecorder)
>       File "/usr/lib/eroaster/main.py", line 1477, in DetectSCSIDevice
> 	output = pipe[0].readlines()
>     IOError: [Errno 4] Interrupted system call
>
> The code around line 1477 in main.py is:
>
>     # Detect SCSI-devices
>     def DetectSCSIDevice(self, device):
>         pipe = popen2.popen2("cdrecord -scanbus 2>&1")
>         output = pipe[0].readlines()
>         devicelist = []
>
> If I execute "cdrecord -scanbus" I get the appropriate output for
> my system:
>
>     Cdrecord 1.9 (i586-mandrake-linux-gnu) Copyright (C) 1995-2000 Jörg Schilling
>     Linux sg driver version: 3.1.19
>     Using libscg version 'schily-0.1'
>     scsibus0:
>         0,0,0     0) *
>         0,1,0     1) 'IBM-PSG ' 'DPSS-318350N  M ' 'S9AA' Disk
>         0,2,0     2) 'QUANTUM ' 'ATLAS_V__9_WLS  ' '0230' Disk
>         0,3,0     3) 'HP      ' 'CD-Writer+ 9200 ' '1.0e' Removable CD-ROM
>         0,4,0     4) 'NEC     ' 'CD-ROM DRIVE:222' '3.1k' Removable CD-ROM
>         0,5,0     5) 'HP      ' 'HP35470A        ' 'T503' Removable Tape
>         0,6,0     6) *
>         0,7,0     7) *
>
> This exact application used to run just fine a month or two ago.
> Since then I've updated my kernel from 2.4.3 to 2.4.7-12.3mdk on
> my Mandrake 8.0 system.  I'm sure I've made a few more updates,
> like all of Mandrake's security patches.
>
>
> Does anyone know what's going wrong here?  Does anyone have any
> debugging suggestions?  I'm an experienced programmer/debugger
> but I'm totally new to python.

The problem is most likely the "2>&1" in the call to popen2(). Redirection is
a shell function; popen*() just execute the process seperately, so cdrecord
thinks that "2>&1" is a (bad) argument. It should use popen4() instead.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>

   "As far as I can tell / It doesn't matter who you are /
    If you can believe there's something worth fighting for."
       - "Parade", Garbage





More information about the Python-list mailing list