First problem that comes to mind is that os.system() returns 0 if the command goes well - since to OS's 0 is true and none 0 is false, on the other hand, Python sees this a little differently. What this means to you?

Is you need to change lines like this..

Code:

failure = os.system(cmd)
if failure: faile(cmd)

into something like..

Code:

success = os.system(cmd)
if not success: faile(cmd)

I may be wrong, but that makes a lot of sence to me . Then i am a little odd .

You might also want to loose re, and shutil from your import statment since they are not being used anywhere in the program as of yet . This means that you have to waist time importing something your program never uses.

That line looks ok, but is it possible that it is not using the regular ASCII character set? If it is has a character from the extended unicode char set in the line, then it may make Python choke. That is the only thing I can think of that would cause that error message.