This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hawkowl
Recipients hawkowl
Date 2019-05-14.02:02:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557799343.57.0.564179832858.issue36911@roundup.psfhosted.org>
In-reply-to
Content
reproducing case:

file.py:

```
"""
Hello \n blah.
"""
```

And then in a REPL (2.7 or 3+):

```
>>> import ast
>>> f = ast.parse(open("test.py", 'rb').read())
>>> f
<_ast.Module object at 0x7f609d0a4d68>
>>> f.body[0]
<_ast.Expr object at 0x7f609d0a4e10>
>>> f.body[0].value
<_ast.Str object at 0x7f609d02b780>
>>> f.body[0].value.s
'\nHello \n blah.\n'
>>> repr(f.body[0].value.s)
"'\\nHello \\n blah.\\n'"
```

Expected behaviour:
```
>>> repr(f.body[0].value.s)
"'\\nHello \\\\n blah.\\n'"
```
History
Date User Action Args
2019-05-14 02:02:23hawkowlsetrecipients: + hawkowl
2019-05-14 02:02:23hawkowlsetmessageid: <1557799343.57.0.564179832858.issue36911@roundup.psfhosted.org>
2019-05-14 02:02:23hawkowllinkissue36911 messages
2019-05-14 02:02:23hawkowlcreate