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

Backslash at end of script raises TypeError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.6.3
    • Component/s: Scripting
    • Labels:
      None

      Description

      Having a script end with a backslash (start of an escape sequence) raises a TypeError. Expected would be a ScriptError, ideally ScriptEndOfFile

      Traceback (most recent call last):
      File "/home/phw/devel/musicbrainz/picard/test/test_script.py", line 1017, in test_char_escape_end_of_file
      self.assertRaises(ScriptEndOfFile, self.parser.eval, 'foo
      ')
      File "/usr/lib/python3.9/unittest/case.py", line 733, in assertRaises
      return context.handle('assertRaises', args, kwargs)
      File "/usr/lib/python3.9/unittest/case.py", line 201, in handle
      callable_obj(*args, **kwargs)
      File "/home/phw/devel/musicbrainz/picard/picard/script/parser.py", line 382, in eval
      ScriptParser._cache[key] = self.parse(script, True)
      File "/home/phw/devel/musicbrainz/picard/picard/script/parser.py", line 373, in parse
      return self.parse_expression(True)[0]
      File "/home/phw/devel/musicbrainz/picard/picard/script/parser.py", line 356, in parse_expression
      tokens.append(self.parse_text(top))
      File "/home/phw/devel/musicbrainz/picard/picard/script/parser.py", line 324, in parse_text
      elif ch not in "$%(),
      ":
      TypeError: 'in <string>' requires string as left operand, not NoneType

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:

                Packages

                Version Package
                2.6.3