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.

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, georg.brandl, loewis, pitrou, python-dev, vstinner
Priority: release blocker Keywords: patch

Created on 2012-08-02 09:06 by ddvoinikov, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fastsearch.patch vstinner, 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 (vstinner) * (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) (Python triager) 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 (vstinner) * (Python committer) Date: 2012-08-02 21:10
The issue should be fixed, thanks for the report!
History
Date User Action Args
2022-04-11 14:57:33adminsetnosy: + georg.brandl
github: 59739
2012-08-02 21:10:37vstinnersetmessages: + 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:07vstinnersetpriority: normal -> release blocker
2012-08-02 12:49:24vstinnersetfiles: + fastsearch.patch

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

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