diff --git a/lark/exceptions.py b/lark/exceptions.py index f3642ac..57eff9d 100644 --- a/lark/exceptions.py +++ b/lark/exceptions.py @@ -66,7 +66,7 @@ class UnexpectedCharacters(LexError, UnexpectedInput): if allowed: message += '\nExpecting: %s\n' % allowed - super(UnexpectedCharacters, self).__init__(message) + super(UnexpectedCharacters, self).__init__(message.encode('utf-8')) @@ -84,6 +84,6 @@ class UnexpectedToken(ParseError, UnexpectedInput): "Expected one of: \n\t* %s\n" % (token, self.line, self.column, '\n\t* '.join(self.expected))) - super(UnexpectedToken, self).__init__(message) + super(UnexpectedToken, self).__init__(message.encode('utf-8')) ###}