Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-1420

Can not save wma file. TypeError: sequence item 0

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.1
    • 2.0.4
    • None
    • Ubuntu 18.10, 4.18.0-12-generic #13-Ubuntu

      Trying to save a .wma file (should be moved to a different folder though) but I get a red error sign at the filename.

      Also clearing tags etc. and then trying to save does not help.
      Googled around since 1,5h but no success.

      Switched the verbosity in the log to debug, here is the output:

      D: 00:21:14,859 /usr/lib/picard/picard/file.update:500: Updating file <File 'cde.wma'>
      D: 00:21:14,860 /usr/lib/picard/picard/formats/asf._save:188: Saving file '/mnt/DataAndBackup/Music/Kaerntner/bla/cde.wma'
      E: 00:21:14,861 /usr/lib/picard/picard/util/thread.run:51: Traceback (most recent call last):
      File "/usr/lib/picard/picard/util/thread.py", line 47, in run
      result = self.func()
      File "/usr/lib/picard/picard/file.py", line 218, in _save_and_rename
      new_filename = self._rename(old_filename, metadata)
      File "/usr/lib/picard/picard/file.py", line 380, in _rename
      self._make_filename(old_filename, metadata))
      File "/usr/lib/picard/picard/file.py", line 349, in _make_filename
      new_filename = self._script_to_filename(naming_format, metadata, settings)
      File "/usr/lib/picard/picard/file.py", line 306, in _script_to_filename
      if isinstance(metadata[name], str):
      File "/usr/lib/picard/picard/metadata.py", line 289, in _getitem_
      return self.get(name, '')
      File "/usr/lib/picard/picard/metadata.py", line 284, in get
      return self.multi_valued_joiner.join(values)
      TypeError: sequence item 0: expected str instance, int found

      D: 00:21:14,867 /usr/lib/picard/picard/file.update:500: Updating file <File 'cde.wma'>

          [PICARD-1420] Can not save wma file. TypeError: sequence item 0

          Great it is working for you, actually trying the daily PPA would have been my next suggestion

           

          So your specific issue got fixed by the fix for PICARD-1375, even though the actual issue is a bit different. To fix the root cause of this I think we have to tackle PICARD-1406. I will close this issue as fixed then, we have PICARD-1406 to take care of the rest.

          Philipp Wolfer added a comment - Great it is working for you, actually trying the daily PPA would have been my next suggestion   So your specific issue got fixed by the fix for PICARD-1375 , even though the actual issue is a bit different. To fix the root cause of this I think we have to tackle PICARD-1406 . I will close this issue as fixed then, we have PICARD-1406 to take care of the rest.

          Kurt Floimair added a comment - - edited

          Thank you for the fast response!
          Sounds like a trace, but what should I do now?

          edit: just a comment: added the daily ppa and: heureka, it is working now with version 2.0.5

          Kurt Floimair added a comment - - edited Thank you for the fast response! Sounds like a trace, but what should I do now? edit: just a comment: added the daily ppa and: heureka, it is working now with version 2.0.5

          This looks related to Philipps comment in https://github.com/metabrainz/picard/pull/1027 (which was a fix for https://tickets.metabrainz.org/browse/PICARD-1375):

          Furthermore the special behavior of metadata.set (namely allowing arbitrary values to be set, including empty, without str conversion)

          Somehow there's an integer value in the metadata for the file, but I'm not sure how. The code after the fix for PICARD-1375 looks like it might not even run into this problem anymore.

          Wieland Hoffmann added a comment - This looks related to Philipps comment in https://github.com/metabrainz/picard/pull/1027 (which was a fix for https://tickets.metabrainz.org/browse/PICARD-1375): Furthermore the special behavior of metadata.set (namely allowing arbitrary values to be set, including empty, without str conversion) Somehow there's an integer value in the metadata for the file, but I'm not sure how. The code after the fix for PICARD-1375 looks like it might not even run into this problem anymore.

          Kurt Floimair added a comment - - edited

          Please find attached the tags for the file which is not possible to be saved.

          I have no plugins active, althoug I have 2 installed (please find attached a screener)

          Here is the custom file naming script, which works in general. Tried it also with the "default" renaming script, which is active from the beginning: same result.

          $if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)%artist%%album%$if($gt(%totaldiscs%,1),CD%discnumber%,)$num(%tracknumber%,2)%title%

          Kurt Floimair added a comment - - edited Please find attached the tags for the file which is not possible to be saved. I have no plugins active, althoug I have 2 installed (please find attached a screener) Here is the custom file naming script, which works in general. Tried it also with the "default" renaming script, which is active from the beginning: same result. $if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)%artist% %album% $if($gt(%totaldiscs%,1),CD%discnumber% ,)$num(%tracknumber%,2) %title%

          Also do you have any plugins active?

          Philipp Wolfer added a comment - Also do you have any plugins active?

          Unfortunately your screenshot doesn't show the tags of the file that failed to save. Does the error also appear for the file that you've highlighted?

          Do you have a custom file naming script active (Options → File Naming)?

          Wieland Hoffmann added a comment - Unfortunately your screenshot doesn't show the tags of the file that failed to save. Does the error also appear for the file that you've highlighted? Do you have a custom file naming script active (Options → File Naming)?

            Unassigned Unassigned
            sepp Kurt Floimair
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.1