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

Crash when disabling script function providing plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.2
    • 2.1.3
    • Scripting
    • None

      IF

      • a activated plugin is providing a scripting function
      • and this scripting function is used in scripting
      • and the user goes to Options > Plugins and disables the plugin, then saves options without removing the scripting function from scripts

      THEN

      • when scripts are applied Picard will crash

      Traceback (most recent call last):
      File "./picard/coverart/_init_.py", line 142, in next_in_queue
      provider = next(self.providers)
      StopIteration

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "./picard/webservice/_init_.py", line 442, in _process_reply
      self._handle_reply(reply, request)
      File "./picard/webservice/_init_.py", line 431, in _handle_reply
      handler(reply.readAll(), reply, error)
      File "./picard/coverart/_init_.py", line 121, in _coverart_downloaded
      self.next_in_queue()
      File "./picard/coverart/_init_.py", line 158, in next_in_queue
      self.next_in_queue()
      File "./picard/coverart/_init_.py", line 158, in next_in_queue
      self.next_in_queue()
      File "./picard/coverart/_init_.py", line 158, in next_in_queue
      self.next_in_queue()
      [Previous line repeated 2 more times]
      File "./picard/coverart/_init_.py", line 162, in next_in_queue
      self.album._finalize_loading(None)
      File "./picard/album.py", line 335, in _finalize_loading
      parser.eval(s_text, track.metadata)
      File "./picard/script.py", line 294, in eval
      return ScriptParser._cache[key].eval(self)
      File "./picard/script.py", line 133, in eval
      return "".join([item.eval(state) for item in self])
      File "./picard/script.py", line 133, in <listcomp>
      return "".join([item.eval(state) for item in self])
      File "./picard/script.py", line 124, in eval
      args = [arg.eval(parser) for arg in self.args]
      File "./picard/script.py", line 124, in <listcomp>
      args = [arg.eval(parser) for arg in self.args]
      File "./picard/script.py", line 133, in eval
      return "".join([item.eval(state) for item in self])
      File "./picard/script.py", line 133, in <listcomp>
      return "".join([item.eval(state) for item in self])
      File "./picard/script.py", line 122, in eval
      function, eval_args, num_args = parser.functions[self.name]
      KeyError: 'replace_forbidden'
      zsh: abort (core dumped) ./tagger.py test/data/test.wav

      The crash does not happen again if the plugin is disabled already on start. In this case applying the script will just raise

      picard.script.ScriptUnknownFunction: Unknown function 'replace_forbidden'
      E: 07:55:41,622 album._finalize_loading:337: Failed to run tagger script Test replace_forbidden on track

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

              Created:
              Updated:
              Resolved:

                Version Package
                2.2