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

Crash parsing bad date in metadata

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.4
    • 2.4.0b2
    • None
    • None
    • I'm testing this with 2.4.0b2 source on Windows 10 and Python 3.8.3

      I am seeing a crash when I try to run a scan (acoustic fingerprint) on a .flac file with a pre-existing bad date in the metadata.

      Here is the crash:

      Traceback (most recent call last):
        File ".\picard\webservice\__init__.py", line 462, in _process_reply
          self._handle_reply(reply, request)
        File ".\picard\webservice\__init__.py", line 449, in _handle_reply
          handler(document, reply, error)
        File ".\picard\acoustid\__init__.py", line 125, in _on_lookup_finished
          next_func(doc, http, error)
        File ".\picard\file.py", line 735, in _lookup_finished
          trackmatch = self._match_to_track(tracks, threshold=threshold)
        File ".\picard\file.py", line 762, in _match_to_track
          best_match = find_best_match(candidates, no_match)
        File ".\picard\util\__init__.py", line 593, in find_best_match
          sorted_results = sort_by_similarity(candidates)
        File ".\picard\util\__init__.py", line 585, in sort_by_similarity
          return sorted(
        File ".\picard\file.py", line 759, in candidates
          yield self.metadata.compare_to_track(track, self.comparison_weights)
        File ".\picard\metadata.py", line 349, in compare_to_track
          release_parts = self.compare_to_release_parts(release, weights)
        File ".\picard\metadata.py", line 270, in compare_to_release_parts
          metadata_year = extract_year_from_date(metadata_date)
        File ".\picard\util\__init__.py", line 660, in extract_year_from_date
          parsed_dt = parse(dt)
        File "C:\Python\Python38-32\lib\site-packages\dateutil\parser\_parser.py", line 1374, in parse
          return DEFAULTPARSER.parse(timestr, **kwargs)
        File "C:\Python\Python38-32\lib\site-packages\dateutil\parser\_parser.py", line 649, in parse
          raise ParserError("Unknown string format: %s", timestr)
      dateutil.parser._parser.ParserError: Unknown string format: 2015; 2015
      

      Definitely a bad date "2015; 2015", but it shouldn't crash.

            zas Zas
            thebradleys Jami Bradley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Version Package
                2.4