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

picard crashes when opening the options dialog if the cwd doesn't exist

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: File Move & Rename
    • Labels:
      None
    • Environment:
      openSUSE Tumbleweed

      Description

      This happens when running "picard ." on a directory that was removed because the files were saved and moved to a different location. The backtrace:

      Traceback (most recent call last):
       File "/usr/lib64/python3.6/site-packages/picard/ui/options/renaming.py", line 130, in check_formats
         self.update_examples()
       File "/usr/lib64/python3.6/site-packages/picard/ui/options/renaming.py", line 162, in update_examples
         example1 = self._example_to_filename(self.example_1())
       File "/usr/lib64/python3.6/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.6/site-packages/picard/file.py", line 358, in _make_filename
         config.setting['windows_compatibility_drive_root'])
       File "/usr/lib64/python3.6/site-packages/picard/util/filenaming.py", line 307, in make_short_filename
         basedir = os.path.abspath(basedir)
       File "/usr/lib64/python3.6/posixpath.py", line 376, in abspath
         cwd = os.getcwd()
      FileNotFoundError: [Errno 2] No such file or directory
      Aborted (core dumped)

       

      The way to reproduce it:

       

      mkdir foo
      cd foo
      picard .
      

      Now on a different terminal, do

      rmdir foo
      

      And on picard, open the Options dialog. Picard will crash due to a call to os.getcwd() raising an exception inside os.path.abspath/realpath .

        Attachments

          Activity

            People

            • Assignee:
              antlarr Antonio Larrosa Jiménez
              Reporter:
              antlarr Antonio Larrosa Jiménez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: