Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError in AST Generation #6

Open
sumitsuthar opened this issue Jul 27, 2017 · 0 comments
Open

UnicodeEncodeError in AST Generation #6

sumitsuthar opened this issue Jul 27, 2017 · 0 comments

Comments

@sumitsuthar
Copy link

Unable to parse following code snippet
utf8_text = u'\xc1rv\xedzt\xfbr\xf5t\xfck\xf6rf\xfar\xf3g\xe9'
Found following exception:
File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 39, in ast2json to_return[attr] = get_value(getattr(node, attr)) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 59, in get_value return [get_value(x) for x in attr_value] File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 61, in get_value return ast2json(attr_value) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 39, in ast2json to_return[attr] = get_value(getattr(node, attr)) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 59, in get_value return [get_value(x) for x in attr_value] File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 61, in get_value return ast2json(attr_value) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 39, in ast2json to_return[attr] = get_value(getattr(node, attr)) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 59, in get_value return [get_value(x) for x in attr_value] File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 61, in get_value return ast2json(attr_value) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 39, in ast2json to_return[attr] = get_value(getattr(node, attr)) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 61, in get_value return ast2json(attr_value) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 39, in ast2json to_return[attr] = get_value(getattr(node, attr)) File "/Library/Python/2.7/site-packages/ast2json/ast2json.py", line 55, in get_value return decode_str(attr_value) File "/Library/Python/2.7/site-packages/ast2json/py2/__init__.py", line 12, in decode_str return codecs.getencoder('hex_codec')(value)[0].decode('utf-8') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/hex_codec.py", line 24, in hex_encode output = binascii.b2a_hex(input) UnicodeEncodeError: 'ascii' codec can't encode character u'\xc1' in position 0: ordinal not in range(128)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant