Message342511
The existing behavior is what I'd expect.
Using python3:
>>> import ast
>>> s = open('file.py', 'rb').read()
>>> s
b'"""\nHello \\n blah.\n"""\n'
>>> ast.dump(ast.parse(s))
"Module(body=[Expr(value=Str(s='\\nHello \\n blah.\\n'))])"
>>> eval(s)
'\nHello \n blah.\n'
As always with the AST, some information is lost. It's not designed to be able to round-trip back to the source text. |
|
Date |
User |
Action |
Args |
2019-05-14 20:11:38 | eric.smith | set | recipients:
+ eric.smith, mbussonn, hawkowl |
2019-05-14 20:11:38 | eric.smith | set | messageid: <1557864698.55.0.267370403677.issue36911@roundup.psfhosted.org> |
2019-05-14 20:11:38 | eric.smith | link | issue36911 messages |
2019-05-14 20:11:38 | eric.smith | create | |
|