Closed ygavenchuk closed 2 years ago
There's a query from pair of symbols which breaks the error handling of the parser, so we can't get relevant information about the syntax error.
How to reproduce:
from luqum.parser import parser parser.parse('~]')
Expected result: ParseSyntaxError Actual result: TypeError: __str__ returned non-string (type NoneType)
ParseSyntaxError
TypeError: __str__ returned non-string (type NoneType)
Possible fix:
Update the TokenValue.__str__ method to always return string. I.e.
TokenValue.__str__
class TokenValue: # ... def __str__(self): return str(self.value)
Hello @ygavenchuk, that's a good idea.
No problem
@alexgarel could you review https://github.com/jurismarches/luqum/pull/74?
@alexgarel will you be publishing a patch release for this fix?
There's a query from pair of symbols which breaks the error handling of the parser, so we can't get relevant information about the syntax error.
How to reproduce:
Expected result:
ParseSyntaxError
Actual result:TypeError: __str__ returned non-string (type NoneType)
Possible fix:
Update the
TokenValue.__str__
method to always return string. I.e.