]> granicus.if.org Git - python/commit
Added checks to prevent PyUnicode_Count() from dumping core
authorMarc-André Lemburg <mal@egenix.com>
Tue, 16 Jan 2001 11:54:12 +0000 (11:54 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Tue, 16 Jan 2001 11:54:12 +0000 (11:54 +0000)
commit3a645e4dd4eebbfbbfad8443558bb3b879e23896
tree97fdb22065892ae35ce0f25bf62fbae5718df32d
parent1c5aa6901fb13f8112ead1786868f0f8ed4c9e2d
Added checks to prevent PyUnicode_Count() from dumping core
in case the parameters are out of bounds and fixes error handling
for .count(), .startswith() and .endswith() for the case of
mixed string/Unicode objects.

This patch adds Python style index semantics to PyUnicode_Count()
indices (including the special handling of negative indices).

The patch is an extended version of patch #103249 submitted
by Michael Hudson (mwh) on SF. It also includes new test cases.
Lib/test/string_tests.py
Lib/test/test_unicode.py
Objects/stringobject.c
Objects/unicodeobject.c