The gist of it: astor has a bug where it unescapes escape characters (boo). ast.unparse (Python 3.9+) doesn't have that bug, but since we're not targeting Python 3.9, we can't use that, and using it conditionally doesn't quite work either since it serializes things differently enough to break quite some tests.
The particular form of escape characters can change (octal escapes turn to hexes, and hex escapes are lower-cased), but they're still escaped and not control characters embedded in source.
This PR includes integration tests for the issues it fixes:
The gist of it:
astor
has a bug where it unescapes escape characters (boo).ast.unparse
(Python 3.9+) doesn't have that bug, but since we're not targeting Python 3.9, we can't use that, and using it conditionally doesn't quite work either since it serializes things differently enough to break quite some tests.The particular form of escape characters can change (octal escapes turn to hexes, and hex escapes are lower-cased), but they're still escaped and not control characters embedded in source.
This PR includes integration tests for the issues it fixes:
Fixes #55 Fixes #104