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

mutagen.MutagenError: file not found when filename contains the character U+FFFD

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 2.5.2
    • File Move & Rename
    • None

      • create a file whose filename contains U+FFFD (replacement character)
      • try to add it to picard
      • picard seems to pass the wrong filename to mutagen, making it impossible to process the file further

       

      Note that mutagen-inspect run on the same file does not fail, so I'm guessing that Picard somehow convert the character to a regular '?'.

       

      Traceback:

       

      E: 18:23:18,497 /usr/lib/picard/picard/util/thread.run:64: Traceback (most recent call last):

      File "/usr/lib/python3/dist-packages/mutagen/_util.py", line 251, in _openfile

      fileobj = open(filename, "rb+" if writable else "rb")

      FileNotFoundError: [Errno 2] No such file or directory: b'/home/hiq/buggy_picard/bad_filename_?.flac'

       

      During handling of the above exception, another exception occurred:

       

      Traceback (most recent call last):

      File "/usr/lib/picard/picard/util/thread.py", line 60, in run

      result = self.func()

      File "/usr/lib/picard/picard/file.py", line 178, in _load_check

      return self._load(filename)

      File "/usr/lib/picard/picard/formats/vorbis.py", line 125, in _load

      file = self._File(encode_filename(filename))

      File "/usr/lib/python3/dist-packages/mutagen/file.py", line 48, in __init_

      self.load(*args, **kwargs)

      File "/usr/lib/python3/dist-packages/mutagen/_util.py", line 185, in wrapper

      return func(*args, **kwargs)

      File "/usr/lib/python3/dist-packages/mutagen/_util.py", line 154, in wrapper

      with _openfile(self, filething, filename, fileobj,

      File "/usr/lib/python3.9/contextlib.py", line 117, in _enter_

      return next(self.gen)

      File "/usr/lib/python3/dist-packages/mutagen/_util.py", line 272, in _openfile

      raise MutagenError(e)

      mutagen.MutagenError: [Errno 2] No such file or directory: b'/home/hiq/buggy_picard/bad_filename_?.flac'

            outsidecontext Philipp Wolfer
            hiq hiq
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package