aiwarrior <[EMAIL PROTECTED]> wrote: > Hi i'm having a IO error saying a file does not exist even though > i perform a isFile() check. Can you help me out figuring what is > wrong? > > Thanks in advance > > from mutagen.easyid3 import EasyID3 > from mutagen.mp3 import MP3 > > for root, dirs, files in os.walk('''C:\\Documents and > Settings\\pneves\ \Music\\''', topdown=False): > for name in files: > joined = os.path.join(root, name) > if (name[-3:] == 'mp3' ): > audio = MP3(joined, ID3=EasyID3) > if not audio.has_key('album') and > os.path.isfile(joined): > print os.path.join(root, name) > > I get an error as following: > > IOError: [Errno 2] No such file or directory: 'C:\\Documents and > Settings\\pneves\\Music\\Naked Music - Miguel Migs - Colorful > You\ \Miguel Migs - Colorful you - Full album\\Miguel Migs - > Colorful you - Cd 2 -Mixed and mastered by J. Mark Andrus\\7 - > Miguel Migs feat. Lisa Shaw - You Bring Me Up (Main Vocal > Mix).mp3'
It looks like the error is happending in MP3(join...), so the os.path.isfile check is never reached. If that is the case, something along the lines of: try: audio=MP3(joined, ID3=EasyID3) except: #catches any error in MP3... print joined should suppress the error and print the filename that triggered it. max -- http://mail.python.org/mailman/listinfo/python-list