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

Scanning CDROM uses path containing ampersand (&)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.2
    • 2.1.2
    • None
    • Debian Sid

      My PC contains 2 DVD-ROM drives (one writer).  In the Menu I find 3 entries:

      • /_dev/cdrom
      • /dev/_sr0 (Ctrl-K)
      • /d_ev/sr1

      The action seem to have been assigned keyboard shortcuts 'd', 's' and 'e'. Inside Qt this leads to the action texts getting changed to

      • /&dev/cdrom
      • /dev/&sr0
      • /d&ev/sr1

      When I trigger the action that text containing the ampersand is passed to the function, leading to the following traceback:

      D: 15:45:01,235 /usr/lib/picard/picard/disc.read:52: Reading CD using device: b'/dev/&sr0'
      E: 15:45:01,239 /usr/lib/picard/picard/util/thread.run:56: Traceback (most recent call last):
      File "/usr/lib/picard/picard/disc.py", line 54, in read
      disc = discid.read(device, features=['mcn'])
      File "/usr/lib/python3/dist-packages/libdiscid/compat/discid.py", line 176, in read
      map(lambda feature: _decode(feature, 'ascii'), features))
      File "/usr/lib/python3/dist-packages/libdiscid/compat/discid.py", line 111, in read
      ), 0))
      File "/usr/lib/python3/dist-packages/libdiscid/_init_.py", line 260, in read
      disc.read(device, features)
      File "libdiscid/_discid.pyx", line 92, in libdiscid._discid.DiscId.read
      File "libdiscid/_discid.pyx", line 70, in libdiscid._discid.DiscId._read
      libdiscid.exceptions.DiscError: cannot open device `/dev/&sr0'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "/usr/lib/picard/picard/util/thread.py", line 52, in run
      result = self.func()
      File "/usr/lib/picard/picard/disc.py", line 59, in read
      except discid.disc.DiscError as e:
      AttributeError: module 'libdiscid.compat.discid' has no attribute 'disc'

      Either the & needs to be stripped from the text in tagger.py:706

      or qt_set_sequence_auto_mnemonic could be used to disable the automatic assignment of mnemonics,|

      or best use data() of the action to store the verbatim data.

       

      Probably picard/ui/options/cdlookup.py needs to be modified too, but I have to few Qt knowledge to do that myself.

            zas Zas
            pmhhahn Philipp Hahn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.2