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