[issue38663] Untokenize does not round-trip ws before bs-nl

Edward K Ream report at bugs.python.org
Sun Nov 3 08:17:57 EST 2019


Edward K Ream <edreamleo at gmail.com> added the comment:

The original bug report used a Leo-only function, g.toUnicode. To fix this, replace:

result = g.toUnicode(tokenize.untokenize(tokens))

by:

result_b = tokenize.untokenize(tokens)
result = result_b.decode('utf-8', 'strict')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38663>
_______________________________________


More information about the Python-bugs-list mailing list