tag 288550 patch
thanks
On Sun, Jan 23, 2005 at 07:19:29PM +0100, Chrissie wrote:
On Sat, Jan 22, 2005 at 07:17:18PM -0500, Justin Pryzby wrote:
Hi,
You recently submitted a bug on eroaster,
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288550. I'm unable
to reproduce this; could you add debugging statements to show what are
the value of version[1], len(version[1]), and range(len(version[1]))?
Well, version[1] does not exist, i get the message: index out of range.
I did the following:
versionLine = output[0]
splitted = split(versionLine, )
version = split(splitted[1], .
print debugging output by chrissie
print %s % versionLine
print %s % splitted
print %s % version
And i get the following output:
debugging output by chrissie
cdrecord: Warning: Running on Linux-2.6.10-ac7
['cdrecord:', 'Warning:', 'Running', 'on', 'Linux-2.6.10-ac7']
['Warning:']
Oh. So, cdrecord is outputting to stdout and to stderr, and the first
line that python sees is stderr (because its unbuffered): Warning:
Running on Linux-2.6
I can recommend the following workaround:
- output = cmdoutput(%s -version 21 % self.__cdrecord_command, strip
= TRUE)
+ output = cmdoutput(%s -version 21 |grep -i Copyright %
self.__cdrecord_command, strip = TRUE)
That's untested, but will store the right line. One could also use
+ output = cmdoutput(%s -version 2/dev/null %
self.__cdrecord_command, strip = TRUE)
But I'd have to recommend checking the return value. (The first
method should make sure that grep returns 0 (Match found without
error).
I also did the following on the command line:
[EMAIL PROTECTED]:~$ cdrecord -version
Cdrecord-Clone 2.01.01a01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg
Schilling
NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord
and thus may have bugs that are not present in the original version.
Please send bug reports and support requests to [EMAIL PROTECTED].
The original author should not be bothered with problems of this version.
cdrecord: Warning: Running on Linux-2.6.10-ac7
cdrecord: There are unsettled issues with Linux-2.5 and newer.
cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris
Seems do be a problem on parsing the output of cdrecord -version in my
case...
Yep, for sure. Thanks for following up.
Justin