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

Picard crashes "Replace non-ASCII characters"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 2.0
    • File Move & Rename
    • Gentoo Linux, btrfs

      I'm getting an error whenever I check "rename files" option. I think it is related to the "É" in the example track name.

      Traceback (most recent call last):
        File "/usr/lib64/python3.5/site-packages/picard/ui/options/renaming.py", line 163, in update_examples
          example2 = self._example_to_filename(self.example_2())
        File "/usr/lib64/python3.5/site-packages/picard/ui/options/renaming.py", line 148, in _example_to_filename
          filename = file._make_filename(file.filename, file.metadata, settings)
        File "/usr/lib64/python3.5/site-packages/picard/file.py", line 373, in _make_filename
          return os.path.realpath(os.path.join(new_dirname, new_filename))
        File "/usr/lib64/python3.5/posixpath.py", line 373, in realpath
          path, ok = _joinrealpath(filename[:0], filename, {})
        File "/usr/lib64/python3.5/posixpath.py", line 407, in _joinrealpath
          if not islink(newpath):
        File "/usr/lib64/python3.5/posixpath.py", line 161, in islink
          st = os.lstat(path)
      UnicodeEncodeError: 'ascii' codec can't encode character '\xc9' in position 43: ordinal not in range(128)
      Aborted
      

      I first triggered this by checking "move files", then checking "rename files". This is I assume because "remove non-ASCII" is not checked by default.

      I worked around that by checking "rename files" first, then "replace non-ASCII", then "move files".

      Then, because my filesystem and all devices I'd be using the files aren't using silly filesystems, I tried to uncheck "replace non-ASCII". This causes a crash with the exact same message as above.

      I tried unchecking "move files", since at first when both "move" and "rename" were unchecked, and "replace" was in its default unchecked state, I was able to have "rename" without "replace". But now unchecking "replace" in any case crashes Picard.

        1. test.PNG
          43 kB
          Enjeck Cleopatra

          [PICARD-1287] Picard crashes "Replace non-ASCII characters"

          Ok, thanks for the feedback. I have not yet tried with a locale set to non-UTF8 one.

          Philipp Wolfer added a comment - Ok, thanks for the feedback. I have not yet tried with a locale set to non-UTF8 one.

          Gordon Pettey added a comment -

          I haven't had a chance to check. The problem was not mount options, but the locale in environment.

          Gordon Pettey added a comment - I haven't had a chance to check. The problem was not mount options, but the locale in environment.

          I don't actually think this specific exception has been solved, but I also could not find a way to reproduce it. As the OP points out this seems to be an issue with the filesystem not accepting unicode chars. But I cannot find a way to reproduce this. Here with btrfs on my system I never had any issue regarding this, and I cannot find any hint on a mount option or something to change anything in this regard.

          @petteyg In case you still have these issues, can you share the mount options for your file system?

          Philipp Wolfer added a comment - I don't actually think this specific exception has been solved, but I also could not find a way to reproduce it. As the OP points out this seems to be an issue with the filesystem not accepting unicode chars. But I cannot find a way to reproduce this. Here with btrfs on my system I never had any issue regarding this, and I cannot find any hint on a mount option or something to change anything in this regard. @ petteyg In case you still have these issues, can you share the mount options for your file system?

          Probably related to PICARD-1207. I tried reproducing this issue here with Picard 2.0.2, but could not

          Philipp Wolfer added a comment - Probably related to PICARD-1207 . I tried reproducing this issue here with Picard 2.0.2, but could not

          Urvashi Garg added a comment -

          I tested out the issue using an 'Éxample' file on MacOS high Sierra and Windows 10 with version 2.0.4. I tried both methods, checking move files and then rename files, and then tried checking rename files, remove non ascii, move files and several ways of unchecking all of it, no crashes or problems here either.

          Urvashi Garg added a comment - I tested out the issue using an 'Éxample' file on MacOS high Sierra and Windows 10 with version 2.0.4. I tried both methods, checking move files and then rename files, and then tried checking rename files, remove non ascii, move files and several ways of unchecking all of it, no crashes or problems here either.

          To test out this issue, I renamed a music track to "Éxample". Notice I keep the troublesome accented "É" in the track name. Then I proceeded to follow the above directions, alternating between checking "move files", "rename files" and "replace non-ASCII". There was no crash on my part. I use Picard 2.0.4 on Windows 7. I believe the bug has been fixed.

          Enjeck Cleopatra added a comment - To test out this issue, I renamed a music track to "Éxample". Notice I keep the troublesome accented "É" in the track name. Then I proceeded to follow the above directions, alternating between checking "move files", "rename files" and "replace non-ASCII". There was no crash on my part. I use Picard 2.0.4 on Windows 7. I believe the bug has been fixed.

          This should be fixed with 2.0.3. Can you check and confirm?

          Sambhav Kothari added a comment - This should be fixed with 2.0.3. Can you check and confirm?

          Gordon Pettey added a comment -

          It turns out the filesystem actually is rejecting UTF-8 names for some reason. I can create them manually, but upon later reading they've been physically replaced with ???????.extension (actually renamed, not a font problem). So, in regards to Picard, the issue is just a crash where there might be an error dialog instead.

          Gordon Pettey added a comment - It turns out the filesystem actually is rejecting UTF-8 names for some reason. I can create them manually, but upon later reading they've been physically replaced with ???????.extension (actually renamed, not a font problem). So, in regards to Picard, the issue is just a crash where there might be an error dialog instead.

            Unassigned Unassigned
            petteyg Gordon Pettey
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Version Package