shanenin Posted August 7, 2005 Report Share Posted August 7, 2005 I have been working on a script that rips music cds and encodes, and renames files using the CDDB database. I noticed the script failed when a "/" is in the name of the file I want to change the name to. Example:>>> os.rename('track04.cdda.wav.mp3','The Rolling Stones / Intro Excerpt From Fanfare For The Common Man.mp3')Traceback (most recent call last): File "<stdin>", line 1, in ?OSError: [Errno 2] No such file or directoryif I remove the "/" the above code works just fine, so I am pretty certain the "/" is causing the problembut I am able to use that symbol with string functions>>> 'The Rolling Stones / Intro Excerpt From Fanfare For The Common Man.mp3 '.lower()'the rolling stones / intro excerpt from fanfare for the common man.mp3 'why is it failing with the os.rename() finction Quote Link to post Share on other sites
jcl Posted August 7, 2005 Report Share Posted August 7, 2005 Slash is verboten in filenames. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.