[mp3togo] abort and traceback from mp3togo

Justus Pendleton justus at ryoohki.net
Fri May 19 12:00:47 PDT 2006


Gary Lawrence Murphy wrote:
 > fab idea, but it wouldn't work in my Mandriva 2006 environment:
 >
 >     Encoding mp3: Traceback (most recent call last):
 >       File "/usr/bin/mp3togo", line 25, in ?
 >         main(sys.argv)
 >       File "/usr/lib/python2.4/site-packages/mp3togo/main.py", line 
126, in main
 >         execute_sequential(playlist, opts, cooked)
 >       File "/usr/lib/python2.4/site-packages/mp3togo/main.py", line 
230, in execute_sequential
 >         print "Total time this track: %s\n" % ts
 >     IOError: [Errno 11] Resource temporarily unavailable
 >     Command exited with non-zero status 1
 >
 > any ideas what might have gone wrong?

This usually happens when you try to do I/O and have the stream set to 
be non-blocking. Instead of blocking the C library returns EAGAIN which 
Python turns into a "Resource temporarily unavailable" exception. If 
that's what you meant then you need to catch that exception and then try 
the I/O again later when the stream is available. I don't know if 
mp3togo sets stdout to be non-blocking or if something else is doing it 
-- perhaps Mandriva has compiled their C library to have non-blocking 
set by default. The following code turns blocking back on for stdout

import fcntl
import sys
import os
flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL)
if flags & os.O_NONBLOCK:
     print "removing O_NONBLOCK from sys.stdout"
     fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags & ~os.O_NONBLOCK


You could attempt cutting and pasting that code into mp3togo right 
before the call to main() and see if that fixes things.



More information about the mp3togo mailing list