tags 293329 + patch pending
thanks
* Martin Michlmayr <[EMAIL PROTECTED]> [2005-02-02 15:30]:
> I just got the following error from jack. It wasn't clear at all
> whether the TOC helper or whether /dev/cdrom didn't exist (turned out
> to be the latter).
>
> This is jack 3.1.1 (C)2004 Arne Zellentin <[EMAIL PROTECTED]>
> *warning* config file /etc/jackrc is of unknown version None.
> Traceback (most recent call last):
> File "/usr/lib/python2.3/site-packages/jack_functions.py", line 134, in
> gettoc
> exec(jack_helpers.helpers[toc_prog]['toc_fkt'])
> File "<string>", line 3, in ?
> error: (2, 'No such file or directory')
> Trouble reading the disk's TOC. If you already ripped the CD, you'll have to
> cd into the created directory which is either named after the CD's title
> or still called jack-xxxxxxxx (xxxxxxxx is a hex number).
Here's a patch that makes this much clearer:
diff -urN jack-3.1.1~/jack_functions.py jack-3.1.1/jack_functions.py
--- jack-3.1.1~/jack_functions.py 2005-06-19 22:31:20.446675832 +0100
+++ jack-3.1.1/jack_functions.py 2005-06-19 22:47:42.766340544 +0100
@@ -132,6 +132,8 @@
erg = []
try:
exec(jack_helpers.helpers[toc_prog]['toc_fkt'])
+ except SystemExit:
+ sys.exit(1)
except:
traceback.print_exc()
print "Trouble reading the disk's TOC. If you already ripped the
CD, you'll have to"
diff -urN jack-3.1.1~/jack_helpers.py jack-3.1.1/jack_helpers.py
--- jack-3.1.1~/jack_helpers.py 2005-06-19 22:31:20.446675832 +0100
+++ jack-3.1.1/jack_helpers.py 2005-06-19 22:48:45.138858480 +0100
@@ -478,8 +478,18 @@
'toc': 1,
'toc_fkt': r"""
import cdrom
-device = cdrom.open(cf['_cd_device'])
-(first, last) = cdrom.toc_header(device)
+if not os.path.exists(cf['_cd_device']):
+ print "Device %s does not exist!" % cf['_cd_device']
+ sys.exit(1)
+if not os.access(cf['_cd_device'], os.R_OK):
+ print "You don't have permission to access device %s!" % cf['_cd_device']
+ sys.exit(1)
+try:
+ device = cdrom.open(cf['_cd_device'])
+ (first, last) = cdrom.toc_header(device)
+except cdrom.error, m:
+ print "Access of CD device %s resulted in error: %s" % (cf['_cd_device'],
m[1])
+ sys.exit(0)
toc = []
for i in range(first, last + 1):
(min, sec, frame) = cdrom.toc_entry(device, i)
--
Martin Michlmayr
http://www.cyrius.com/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]