tracknum_and_title_from_filename() raises an exception with a file like '1.opus'

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 3.0.0a1, 2.14
    • Affects Version/s: None
    • Component/s: Other
    • None

      https://github.com/metabrainz/picard/pull/2648

      https://github.com/metabrainz/picard/pull/2648#issuecomment-3689609730

      This broke things for me when the file is just called 1.opus, which is how I name tracks between ripping and tagging.
       {{Picard terminated unexpectedly
      Traceback (most recent call last):
      File "/usr/lib/python3.13/site-packages/picard/tagger.py", line 790, in event
      event.run()
      ~~~~~~~~~^^
      File "/usr/lib/python3.13/site-packages/picard/util/thread.py", line 54, in run
      self.func(*self.args, **self.kwargs)
      ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/picard/file.py", line 299, in _loading_finished
      self._copy_loaded_metadata(result, postprocessors)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/picard/file.py", line 313, in _copy_loaded_metadata
      processor(metadata)
      ~~~~~~~~~^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/picard/file.py", line 320, in _guess_tracknumber_and_title
      guessed = tracknum_and_title_from_filename(self.base_filename)
      File "/usr/lib/python3.13/site-packages/picard/util/_init_.py", line 658, in tracknum_and_title_from_filename
      dot_offset = 1 if stripped_filename[tnlen:][0] == '.' else 0
      ~~~~~~~~~~~~~~~~~~~~~~~~~^^^
      IndexError: string index out of range}}

            Assignee:
            Zas
            Reporter:
            Zas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                3.0.0a1
                2.14