summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.5] bpo-22207: Add checks for possible integer overflows in ↵Serhiy Storchaka2017-07-111-6/+12
| | | | | | unicodeobject.c. (GH-2623) (#2659) Based on patch by Victor Stinner. (cherry picked from commit 64e461be09e23705ecbab43a8b01722186641f71)
* [3.5] bpo-13617: Reject embedded null characters in wchar* strings. ↵Serhiy Storchaka2017-06-281-0/+14
| | | | | | | | | | (GH-2302) (#2463) Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.. (cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
* [3.5] bpo-30708: Add private C API function _PyUnicode_AsWideCharString(). ↵Serhiy Storchaka2017-06-271-0/+31
| | | | | | | | | | (GH-2285) (GH-2443) (#2448) And use it instead of PyUnicode_AsWideCharString() if appropriate. _PyUnicode_AsWideCharString(unicode) is like PyUnicode_AsWideCharString(unicode, NULL), but raises a ValueError if the wchar_t* string contains null characters. (cherry picked from commit e613e6add5f07ff6aad5802924596b631b707d2a). (cherry picked from commit 0edffa3073b551ffeca34952529e7b292f1bd350)
* [3.5] bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). ↵Serhiy Storchaka2017-04-211-0/+1
| | | | | (GH-1217) (#1219) (cherry picked from commit 7a113a0)
* Expand the PySlice_GetIndicesEx macro. (#1023) (#1045)Serhiy Storchaka2017-04-081-2/+3
| | | (cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
* Issue #29145: Fix overflow checks in str.replace() and str.join().Xiang Zhang2017-01-101-6/+8
| | | | Based on patch by Martin Panter.
* Issue #29044: Fix a use-after-free in string '%c' formatter.Xiang Zhang2016-12-221-3/+4
|
* Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-2/+16
|
* Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701).Serhiy Storchaka2016-11-161-1/+1
|
* Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-161-0/+38
| | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
* Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-0/+35
| | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS XSerhiy Storchaka2016-11-121-1/+1
|\ | | | | | | when decode astral characters.
| * Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS XSerhiy Storchaka2016-11-121-1/+1
| |\ | | | | | | | | | when decode astral characters.
| | * Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS XSerhiy Storchaka2016-11-121-1/+1
| | | | | | | | | | | | when decode astral characters.
| | * Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.Serhiy Storchaka2015-12-021-0/+5
| | |
* | | Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug ↵Serhiy Storchaka2016-10-251-10/+2
|\ \ \ | |/ / | | | | | | build.
| * | Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug ↵Serhiy Storchaka2016-10-251-10/+2
| | | | | | | | | | | | build.
* | | remove extra PyErr_Format arguments (closes #28454)Benjamin Peterson2016-10-161-4/+4
| | | | | | | | | | | | Patch from Xiang Zhang.
* | | Issue #28379: Added sanity checks and tests for PyUnicode_CopyCharacters().Serhiy Storchaka2016-10-081-3/+7
| | | | | | | | | | | | Patch by Xiang Zhang.
* | | Fix PyUnicode_FromFormatV() error handlingVictor Stinner2016-09-211-1/+1
| | | | | | | | | | | | | | | Issue #28233: Fix a memory leak if the format string contains a non-ASCII character, destroy the unicode writer.
* | | promote some shifts to unsigned, so as not to invoke undefined behaviorBenjamin Peterson2016-09-071-3/+3
| | |
* | | Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded asSerhiy Storchaka2016-06-181-1/+7
| | | | | | | | | | | | an iterable of integers. Now only strings and byte-like objects are accepted.
* | | Issue #27171: Fix typos in documentation, comments, and test function namesMartin Panter2016-06-021-1/+1
| | |
* | | Correct “an” → “a” with “Unicode”, “user”, “UTF”, etcMartin Panter2016-04-151-1/+1
| | | | | | | | | | | | This affects documentation, code comments, and a debugging messages.
* | | Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-4/+4
| | | | | | | | | | | | in places where Py_DECREF was used.
* | | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-4/+4
| | |
* | | Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-1/+1
| | | | | | | | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | | Issue #26464: Fix unicode_fast_translate() againVictor Stinner2016-03-011-9/+12
| | | | | | | | | | | | Initialize i variable if the string is non-ASCII.
* | | Fix str.translate()Victor Stinner2016-03-011-3/+4
| | | | | | | | | | | | | | | | | | Issue #26464: Fix str.translate() when string is ASCII and first replacements removes character, but next replacement uses a non-ASCII character or a string longer than 1 character. Regression introduced in Python 3.5.0.
* | | Fix resize_compact()Victor Stinner2016-01-271-0/+2
| | | | | | | | | | | | | | | Issue #26217: resize_compact() must set wstr_length to 0 after freeing the wstr string. Otherwise, an assertion fails in _PyUnicode_CheckConsistency().
* | | Issue #20440: More use of Py_SETREF.Serhiy Storchaka2015-12-271-1/+1
| | | | | | | | | | | | | | | This patch is manually crafted and contains changes that couldn't be handled automatically.
* | | Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-8/+4
| | | | | | | | | | | | macro Py_SETREF.
* | | Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.Serhiy Storchaka2015-12-021-0/+5
|\ \ \ | |/ /
| * | Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.Serhiy Storchaka2015-12-021-0/+5
| | |
* | | make the PyUnicode_FSConverter cleanup set the decrefed argument to NULL ↵Benjamin Peterson2015-11-161-0/+1
| | | | | | | | | | | | (closes #25630)
* | | Issue #25523: Merge a-to-an corrections from 3.4.Serhiy Storchaka2015-11-021-2/+2
|\ \ \ | |/ /
| * | Issue #25523: Further a-to-an corrections.Serhiy Storchaka2015-11-021-2/+2
| | |
* | | Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:Serhiy Storchaka2015-10-021-9/+12
|\ \ \ | |/ / | | | | | | | | | | | | | | | 1. Non-ASCII bytes were accepted after shift sequence. 2. A low surrogate could be emitted in case of error in high surrogate. 3. In some circumstances the '\xfd' character was produced instead of the replacement character '\ufffd' (due to a bug in _PyUnicodeWriter).
| * | Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:Serhiy Storchaka2015-10-021-9/+12
| | | | | | | | | | | | | | | 1. Non-ASCII bytes were accepted after shift sequence. 2. A low surrogate could be emitted in case of error in high surrogate.
* | | Issue #21279: Merge with 3.4Zachary Ware2015-08-061-5/+6
|\ \ \ | |/ /
| * | Issue #21279: Flesh out str.translate docsZachary Ware2015-08-061-5/+6
| | | | | | | | | | | | Initial patch by Kinga Farkas, Martin Panter, and John Posner.
* | | Issue #24284: The startswith and endswith methods of the str class no longerSerhiy Storchaka2015-05-311-3/+3
| | | | | | | | | | | | | | | return True when finding the empty string and the indexes are completely out of range.
* | | Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).Antoine Pitrou2015-05-191-3/+3
|\ \ \ | |/ /
| * | Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).Antoine Pitrou2015-05-191-17/+17
| | |
* | | Issue #15027: The UTF-32 encoder is now 3x to 7x faster.Serhiy Storchaka2015-05-121-61/+41
| | |
* | | Issue #23908: os functions now reject paths with embedded null characterSerhiy Storchaka2015-04-201-15/+0
|\ \ \ | |/ / | | | | | | | | | | | | on Windows instead of silently truncate them. Removed no longer used _PyUnicode_HasNULChars().
| * | Issue #23803: Fixed str.partition() and str.rpartition() when a separatorSerhiy Storchaka2015-03-291-5/+5
| | | | | | | | | | | | is wider then partitioned string.
| * | merge 3.3 (#23362)Benjamin Peterson2015-03-021-1/+1
| |\ \ | | |/
| | * use PyMem_NEW to detect overflow (closes #23362)Benjamin Peterson2015-03-021-1/+1
| | |
| | * Issue #23055: Fixed a buffer overflow in PyUnicode_FromFormatV. AnalysisSerhiy Storchaka2015-01-271-0/+2
| | | | | | | | | | | | and fix by Guido Vranken.