[pypy-issue] [issue840] string-escape encoding should escape single quotes

Garen Parham tracker at bugs.pypy.org
Mon Oct 10 01:30:36 CEST 2011


Garen Parham <garen.p at gmail.com> added the comment:

Looks like this has been fixed after 1.6:

$ ~/dev/pypy-c-nojit-47882-3f96afe7cdc2-linux/bin/pypy

Python 2.7.1 (3f96afe7cdc2, Oct 09 2011, 04:21:59)
[PyPy 1.6.1-dev0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"The HHU campus is a good Quake
level" - Armin''
>>>> "'".encode('string-escape') == "\\'"
True
>>>>

Which agrees with CPython:


$ /opt/python27/bin/python
Python 2.7.2 (default, Oct  8 2011, 23:08:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> "'".encode('string-escape') == "\\'"
True
>>>

----------
nosy: +Garen
status: unread -> chatting

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue840>
________________________________________


More information about the pypy-issue mailing list