-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
-
None
from http://bugs.musicbrainz.org/ticket/5972
Renaming fails if the additional files include folders with unchanged paths.
E: <sip.voidptr object at 0x03BC0D10> 12:31:48 Traceback (most recent call last): File "picard\util\thread.pyo", line 80, in generic_run_item File "picard\file.pyo", line 161, in _save_and_rename File "picard\file.pyo", line 319, in _move_additional_files File "shutil.pyo", line 288, in move Error: Cannot move a directory 'K:\_ToDo\Music\___done\Classic Rock\Scorpions (DE)\Album\1980 - Animal Magnetism (2001) (CD, Europe, EMI Music Germany, 5351542)\Covers' into itself 'K:\_ToDo\Music\___done\Classic Rock\Scorpions (DE)\Album\1980 - Animal Magnetism (2001) (CD, Europe, EMI Music Germany, 5351542)\Covers'.problem is with this function in picard\file.pyo
#!python def _move_additional_files(self, old_filename, new_filename, settings): """Move extra files, like playlists...""" old_path = encode_filename(os.path.dirname(old_filename)) new_path = encode_filename(os.path.dirname(new_filename)) patterns = encode_filename(settings["move_additional_files_pattern"]) patterns = filter(bool, [p.strip() for p in patterns.split()]) files = [] for pattern in patterns: # FIXME glob1 is not documented, maybe we need our own implemention? for old_file in glob.glob1(old_path, pattern): new_file = os.path.join(new_path, old_file) old_file = os.path.join(old_path, old_file) # FIXME we shouldn't do this from a thread! if self.tagger.get_file_by_filename(decode_filename(old_file)): self.log.debug("File loaded in the tagger, not moving %r", old_file) continue self.log.debug("Moving %r to %r", old_file, new_file) shutil.move(old_file, new_file)this should fix it
#!python def _move_additional_files(self, old_filename, new_filename, settings): """Move extra files, like playlists...""" old_path = encode_filename(os.path.dirname(old_filename)) new_path = encode_filename(os.path.dirname(new_filename)) patterns = encode_filename(settings["move_additional_files_pattern"]) patterns = filter(bool, [p.strip() for p in patterns.split()]) files = [] for pattern in patterns: # FIXME glob1 is not documented, maybe we need our own implemention? for old_file in glob.glob1(old_path, pattern): new_file = os.path.join(new_path, old_file) old_file = os.path.join(old_path, old_file) # FIXME we shouldn't do this from a thread! if self.tagger.get_file_by_filename(decode_filename(old_file)): self.log.debug("File loaded in the tagger, not moving %r", old_file) continue if old_file != new_file: self.log.debug("Moving %r to %r", old_file, new_file) shutil.move(old_file, new_file)