summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
Commit message (Collapse)AuthorAgeFilesLines
* #8271: merge with 3.3.Ezio Melotti2012-11-041-6/+4
|\
| * #8271: the utf-8 decoder now outputs the correct number of U+FFFD ↵Ezio Melotti2012-11-041-6/+4
| | | | | | | | characters when used with the "replace" error handler on invalid utf-8 sequences. Patch by Serhiy Storchaka, tests by Ezio Melotti.
* | merge 3.3 (#16369)Benjamin Peterson2012-10-301-0/+6
|\ \ | |/
| * merge 3.2 (#16369)Benjamin Peterson2012-10-301-0/+6
| |\
| | * initialize more global type objects (closes #16369)Benjamin Peterson2012-10-301-0/+6
| | |
| | * Issue #14700: Fix buggy overflow checks for large precision and width in ↵Mark Dickinson2012-10-281-2/+2
| | | | | | | | | | | | new-style and old-style formatting.
* | | Close #14625: Rewrite the UTF-32 decoder. It is now 3x to 4x fasterVictor Stinner2012-10-301-73/+69
| | | | | | | | | | | | Patch written by Serhiy Storchaka.
* | | Issue #16330: Use surrogate-related macrosVictor Stinner2012-10-301-4/+3
| | | | | | | | | | | | Patch written by Serhiy Storchaka.
* | | Replace usage of the deprecated Py_UNICODE_COPY() with Py_MEMCPY() in ↵Victor Stinner2012-10-231-2/+2
| | | | | | | | | | | | resize_copy()
* | | Optimize _PyUnicode_HasNULChars(): use findchar() instead of ↵Victor Stinner2012-10-231-7/+9
| | | | | | | | | | | | PyUnicode_Contains()
* | | Inline raise_translate_exception(): it is only used onceVictor Stinner2012-10-231-15/+4
| | |
* | | Optimize PyUnicode_RichCompare() for Py_EQ and Py_NE: always use memcmp()Victor Stinner2012-10-231-26/+44
| | |
* | | Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unifiedChristian Heimes2012-10-171-13/+5
| | | | | | | | | | | | endianess detection and handling.
* | | Issue #14783: Merge changes from 3.3.Chris Jerdonek2012-10-071-1/+2
|\ \ \ | |/ /
| * | Issue #14783: Merge changes from 3.2.Chris Jerdonek2012-10-071-1/+2
| |\ \ | | |/
| | * Issue #14783: Improve int() docstring and also str(), range(), and slice().Chris Jerdonek2012-10-071-1/+2
| | | | | | | | | | | | | | | | | | This commit rewrites the docstring for int() to incorporate the documentation changes made in issue #16036. It also switches the docstrings for int(), str(), range(), and slice() to use multi-line signatures.
* | | Cleanup PyUnicode_FromFormatV() for zero paddingVictor Stinner2012-10-061-1/+5
| | | | | | | | | | | | | | | Skip the "0" instead of parsing it twice: detect zero padding and then parsed as a digit of the width.
* | | Issue #16147: PyUnicode_FromFormatV() doesn't need anymore to allocate a bufferVictor Stinner2012-10-061-46/+14
| | | | | | | | | | | | on the heap to format numbers.
* | | Issue #16147: PyUnicode_FromFormatV() now raises an error if the argument ofVictor Stinner2012-10-061-0/+5
| | | | | | | | | | | | '%c' is not in the range(0x110000).
* | | Issue #16147: PyUnicode_FromFormatV() now detects integer overflow when parsingVictor Stinner2012-10-061-1/+11
| | | | | | | | | | | | width and precision
* | | Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter APIVictor Stinner2012-10-061-483/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Simplify the code: replace 4 steps with one unique step using the _PyUnicodeWriter API. PyUnicode_Format() has the same design. It avoids to store intermediate results which require to allocate an array of pointers on the heap. * Use the _PyUnicodeWriter API for speed (and its convinient API): overallocate the buffer to reduce the number of "realloc()" * Implement "width" and "precision" in Python, don't rely on sprintf(). It avoids to need of a temporary buffer allocated on the heap: only use a small buffer allocated in the stack. * Add _PyUnicodeWriter_WriteCstr() function * Split PyUnicode_FromFormatV() into two functions: add unicode_fromformat_arg(). * Inline parse_format_flags(): the format of an argument is now only parsed once, it's no more needed to have a subfunction. * Optimize PyUnicode_FromFormatV() for characters between two "%" arguments: search the next "%" and copy the substring in one chunk, instead of copying character per character.
* | | Issue #16096: Merge fixes from 3.3.Mark Dickinson2012-10-061-14/+9
|\ \ \ | |/ /
| * | Issue #16096: Fix several occurrences of potential signed integer overflow. ↵Mark Dickinson2012-10-061-14/+9
| | | | | | | | | | | | Thanks Serhiy Storchaka.
* | | In debug mode, unicode_write_cstr() now checks that non-ASCII characters areVictor Stinner2012-10-061-0/+8
| | | | | | | | | | | | not written into an ASCII string
* | | #16127: merge with 3.3.Ezio Melotti2012-10-051-10/+4
|\ \ \ | |/ /
| * | #16127: remove outdated references to narrow builds. Patch by Serhiy Storchaka.Ezio Melotti2012-10-051-10/+4
| | |
| * | Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failedVictor Stinner2012-10-051-1/+3
| | | | | | | | | | | | | | | This error cannot occur in practice: PyUnicode_FromObject() always return a "ready" string.
* | | Optimize unicode_compare(): use memcmp() when comparing two UCS1 stringsVictor Stinner2012-10-041-8/+25
| | |
* | | Enable also ptr==ptr optimization in PyUnicode_Compare()Victor Stinner2012-10-041-4/+5
| | | | | | | | | | | | It was already implemented in PyUnicode_RichCompare()
* | | unicode_result_wchar(): move the assert() to the "#ifdef Py_DEBUG" blockVictor Stinner2012-10-041-3/+3
| | |
* | | Split the huge PyUnicode_Format() function (+540 lines) into subfunctionsVictor Stinner2012-10-041-472/+605
| | |
* | | PyUnicode_Format(): disable overallocation when we are writing the last partVictor Stinner2012-10-031-1/+3
| | | | | | | | | | | | of the output string
* | | Unicode: resize_compact() and resize_inplace() fills also the Unicode stringsVictor Stinner2012-10-031-5/+33
| | | | | | | | | | | | with invalid bytes in debug mode, as done by PyUnicode_New()
* | | Issue #15609: Fix refleak introduced by my last optimizationVictor Stinner2012-10-021-1/+4
| | |
* | | Issue #15609: Optimize str%args for integer argumentVictor Stinner2012-10-021-67/+101
|/ / | | | | | | | | | | | | | | | | | | - Use _PyLong_FormatWriter() instead of formatlong() when possible, to avoid a temporary buffer - Enable the fast path when width is smaller or equals to the length, and when the precision is bigger or equals to the length - Add unit tests! - formatlong() uses PyUnicode_Resize() instead of _PyUnicode_FromASCII() to resize the output string
* | Issue #15379: Fix passing of non-BMP characters as integers for the charmap ↵Antoine Pitrou2012-09-231-3/+4
|\ \ | |/ | | | | | | | | decoder (already working as unicode strings). Patch by Serhiy Storchaka.
| * Issue #15379: Fix passing of non-BMP characters as integers for the charmap ↵Antoine Pitrou2012-09-231-2/+26
| | | | | | | | | | | | decoder (already working as unicode strings). Patch by Serhiy Storchaka.
* | Issue #15144: Fix possible integer overflow when handling pointers as ↵Antoine Pitrou2012-09-201-9/+6
| | | | | | | | | | | | integer values, by using Py_uintptr_t instead of size_t. Patch by Serhiy Storchaka.
* | Issue #15900: Fixed reference leak in PyUnicode_TranslateCharmap()Christian Heimes2012-09-111-6/+5
| |
* | Fixed memory leak in error branch of formatfloat(). CID 719687Christian Heimes2012-09-101-1/+3
| |
* | Fix C++-style comment (xlc compilation failure)Antoine Pitrou2012-09-021-1/+1
| |
* | merge 3.2 (#15801)Benjamin Peterson2012-08-281-2/+1
|\ \ | |/
| * use the stricter PyMapping_Check (closes #15801)Benjamin Peterson2012-08-281-2/+1
| |
* | Issue #15728: Fix leak in PyUnicode_AsWideCharString(). Found by Coverity.Stefan Krah2012-08-191-1/+3
| |
* | Merge str docstring fix from 3.2Nick Coghlan2012-08-161-4/+8
|\ \ | |/
| * Fix str docstringNick Coghlan2012-08-161-4/+8
| |
| * Issue #14579: Fix CVE-2012-2135: vulnerability in the utf-16 decoder after ↵Antoine Pitrou2012-07-211-31/+21
| | | | | | | | | | | | error handling. Patch by Serhiy Storchaka.
* | Use correct types for ASCII_CHAR_MASK integer constants.Mark Dickinson2012-07-071-2/+2
| |
* | Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.Antoine Pitrou2012-06-161-15/+48
| | | | | | | | Patch by Serhiy Storchaka.
* | _copy_characters(): move debug code at the top to avoid noisy #ifdefVictor Stinner2012-06-161-26/+23
| | | | | | | | | | And don't use assert() anymore if check_maxchar is set: return -1 on error instead.