(noob alert) why doesn't this work?

Simon Brunning simon.brunning at gmail.com
Tue Mar 22 06:18:27 EST 2005


On Tue, 22 Mar 2005 12:10:50 +0100, Bouke Woudstra
<bouke at gentoolinux.demon.nl> wrote:
> Hi,
> 
> I'm a bit stuck with this python script. It's aim is to encode all flac files
> to wav and then to mp3. The only problem I have is to preserve the tags. The
> code works when there's just one flac file in a directory but fails for more.
> I can't see why the for loop fails here (flactags).
> 
> The error thrown is: UnboundLocalError: local variable 'title' referenced
> before assignment

Perhaps you get to line 56 without having gone through line 51? Might
one of your flac files not have a title line?

> I don't understand why this isn't assigned. I suspect that self.wav2mp3
> doesn't wait for the first part to finish, but how to force it to wait?

Nope. Looks asynchronous to me.

-- 
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list