summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAndrew Dalke <dalke@dalkescientific.com>2006-05-25 17:53:00 (GMT)
committerAndrew Dalke <dalke@dalkescientific.com>2006-05-25 17:53:00 (GMT)
commit8c9091074b6a0e7e48eb2cce03a4eb193cb993be (patch)
tree00401c251222ba1b77739198ccf1d583fca17285 /Python
parentda53afa1b09218c0fb7ce8803cd783a43ee9d319 (diff)
downloadcpython-8c9091074b6a0e7e48eb2cce03a4eb193cb993be.zip
cpython-8c9091074b6a0e7e48eb2cce03a4eb193cb993be.tar.gz
cpython-8c9091074b6a0e7e48eb2cce03a4eb193cb993be.tar.bz2
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify the copied string in-place. However, 1 (and 0) character strings are shared from a cache. This cause "A".replace("A", "a") to change the cached version of "A" -- used by everyone. Now may the copy with NULL as the string and do the memcpy manually. I've added regression tests to check if this happens in the future. Perhaps there should be a PyString_Copy for this case?
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions