Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug in unicode encoding of reprs.
The previous implementation could lead to double-decoding: >>> from parsimonious.utils import Token >>> repr(Token('asdf')) '<Token "asdf">' >>> repr(Token(u'💣')) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "parsimonious/utils.py", line 19, in __repr__ return self.__str__().encode('utf-8') UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 8: ordinal not in range(128)
- Loading branch information