classification
Title: xmlrpc escaping breaks on unicode \u043c
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ddvoinikov, flox, haypo, loewis, pitrou, python-dev
Priority: release blocker Keywords: patch

Created on 2012-08-02 09:06 by ddvoinikov, last changed 2012-08-02 21:10 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
fastsearch.patch haypo, 2012-08-02 12:49 review
Messages (5)
msg167199 - (view) Author: Dmitry Dvoinikov (ddvoinikov) Date: 2012-08-02 09:06
For the following script
------------------------------------
import xmlrpc.client; from xmlrpc.client import escape
text = "...\u043c......<"
print(escape(text))
------------------------------------
Python 3.3.0b1 produces
...ь..&lt;...<
whereas Python 3.2
...ь......&lt;
msg167210 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2012-08-02 12:49
Hum, it's a regression introduced by the super-optimized fastsearch. It is just a typo: _s => s. I renamed _s to ptr to avoid future confusion ;-)

--

For your information, str.find(), str.rfind(), str.index(), str.rindex() and str.replace() are now using memchr() and memrchr() to find a substring, even if the substring contains characters outside the ASCII (U+0000-U+007F) and latin1 ranges (U+0000-U+00FF). memchr() and memrchr() are much faster than a dummy C loop, even if there are false positive.
msg167211 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-08-02 13:00
Ow, nice find.
msg167254 - (view) Author: Roundup Robot (python-dev) Date: 2012-08-02 21:09
New changeset 0e95b61af859 by Victor Stinner in branch 'default':
Close #15534: Fix a typo in the fast search function of the string library (_s => s)
http://hg.python.org/cpython/rev/0e95b61af859
msg167255 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2012-08-02 21:10
The issue should be fixed, thanks for the report!
History
Date User Action Args
2012-08-02 21:10:37hayposetmessages: + msg167255
2012-08-02 21:09:18python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg167254

resolution: fixed
stage: resolved
2012-08-02 13:00:34pitrousetmessages: + msg167211
2012-08-02 12:50:07hayposetpriority: normal -> release blocker
2012-08-02 12:49:24hayposetfiles: + fastsearch.patch

nosy: + loewis, pitrou, flox, haypo
messages: + msg167210

keywords: + patch
2012-08-02 09:06:37ddvoinikovcreate