summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix grammar in doc string, RST markupMartin Panter2017-01-241-2/+2
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-3/+1
| | | | possible. Patch is writen with Coccinelle.
* Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()Serhiy Storchaka2017-01-221-2/+2
| | | | is now of type "const char *" rather of "char *".
* Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-171-2/+2
| | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
* Issue #20180: forgot to update AC output.INADA Naoki2017-01-161-18/+18
|
* Issue #20180: convert unicode methods to AC.INADA Naoki2017-01-161-408/+511
|
* Issue #29145: Merge 3.6.Xiang Zhang2017-01-101-139/+98
|\
| * Issue #29044: Merge 3.6.Xiang Zhang2016-12-221-139/+98
| |\
| | * Issue #28822: Adjust indices handling of PyUnicode_FindChar().Xiang Zhang2016-12-201-8/+4
| | |
| | * Merge 3.6.Xavier de Gaye2016-12-151-131/+94
| | |\
| | | * Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-061-2/+16
| | | |\
| | | * | Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
| | | * | Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
| | | * | Issue #28774: Simplified encoding a str result of an error handler in ASCIISerhiy Storchaka2016-11-231-26/+12
| | | | | | | | | | | | | | | | | | | | and Latin1 encoders.
| | | * | Issue #28774: Fix start/end pos in unicode_encode_ucs1().Xiang Zhang2016-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix error position of the unicode error in ASCII and Latin1 encoders when a string returned by the error handler contains multiple non-encodable characters (non-ASCII for the ASCII codec, characters out of the U+0000-U+00FF range for Latin1).
| | | * | Issue #28760: Clean up and fix comments in PyUnicode_AsUnicodeEscapeString().Serhiy Storchaka2016-11-211-10/+4
| | | |\ \ | | | | | | | | | | | | | | | | | | Patch by Xiang Zhang.
| | | * | | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-201-49/+45
| | | | | | | | | | | | | | | | | | | | | | | | functions.
| | | * | | Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString nowSerhiy Storchaka2016-11-161-55/+36
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | require ASCII right argument and assert this condition in debug build.
| | | | * \ \ Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701).Serhiy Storchaka2016-11-161-1/+1
| | | | |\ \ \
| | | | * \ \ \ Issue #21449: Removed private function _PyUnicode_CompareWithId.Serhiy Storchaka2016-11-161-55/+36
| | | | |\ \ \ \
| | | | | * \ \ \ Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-161-55/+36
| | | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | | | | * \ \ \ \ \ Closes #27781: Removes special cases for the experimental aspect of PEP 529Steve Dower2016-11-061-10/+1
| | | | | | |\ \ \ \ \ \
| | | | | | * | | | | | | Issue 28128: Print out better error/warning messages for invalid string escapes.Eric V. Smith2016-10-311-6/+32
| | | | | | | | | | | | |
| | | | | | * | | | | | | Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),Serhiy Storchaka2016-10-271-0/+21
| | | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and PyUnicode_AsEncodedUnicode().
| | | | | | * \ \ \ \ \ \ \ Issue #28408: Fixed a leak and remove redundant code in ↵Serhiy Storchaka2016-10-251-55/+36
| | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _PyUnicodeWriter_Finish(). Patch by Xiang Zhang.
| | | | | | | * \ \ \ \ \ \ \ Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug ↵Serhiy Storchaka2016-10-251-55/+36
| | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build.
| | | | | | | | * | | | | | | | Issue #28439: Remove redundant checks in PyUnicode_EncodeLocale andSerhiy Storchaka2016-10-231-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyUnicode_DecodeLocaleAndSize. Patch by Xiang Zhang.
| | | | | | | | * | | | | | | | Issue #28511: Use the "U" format instead of "O!" in PyArg_Parse*.Serhiy Storchaka2016-10-231-3/+3
| | | | | | | | | | | | | | | |
| | | | | | | | * | | | | | | | Issue #28504: Cleanup unicode_decode_call_errorhandler_wchar/writer.Serhiy Storchaka2016-10-221-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Xiang Zhang.
| | | | | | | | * | | | | | | | Issue #28410: Added _PyErr_FormatFromCause() -- the helper for raisingSerhiy Storchaka2016-10-211-5/+2
| | | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new exception with setting current exception as __cause__. _PyErr_FormatFromCause(exception, format, args...) is equivalent to Python raise exception(format % args) from sys.exc_info()[1]
| | | | | | | | * \ \ \ \ \ \ \ \ merge 3.6 (#28454)Benjamin Peterson2016-10-161-4/+4
| | | | | | | | |\ \ \ \ \ \ \ \ \
| | | | | | | | * \ \ \ \ \ \ \ \ \ Merge 3.6Victor Stinner2016-10-121-9/+5
| | | | | | | | |\ \ \ \ \ \ \ \ \ \
| | | | | | | | | * \ \ \ \ \ \ \ \ \ merge 3.6 (#28417)Benjamin Peterson2016-10-111-1/+0
| | | | | | | | | |\ \ \ \ \ \ \ \ \ \
| | | | | | | | | * | | | | | | | | | | Issue #28400: Removed uncessary checks in unicode_char and resize_copy.Serhiy Storchaka2016-10-091-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. In resize_copy we don't need to PyUnicode_READY(unicode) since when it's not PyUnicode_WCHAR_KIND it should be ready. 2. In unicode_char, PyUnicode_1BYTE_KIND is handled by get_latin1_char. Patch by Xiang Zhang.
* | | | | | | | | | | | | | | | | | | | Issue #29145: Merge 3.5.Xiang Zhang2017-01-101-6/+8
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | 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: Merge 3.5.Xiang Zhang2016-12-221-1194/+1292
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / / / / |/| / / / / / / / / / / / / / / / / / / | |/ / / / / / / / / / / / / / / / / /
| * | | | | | | | | | | | | | | | | | Issue #26919: On Android, operating system data is now always encoded/decodedXavier de Gaye2016-12-151-3/+3
| | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
| * | | | | | | | | | | | | | | | | Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-061-2/+16
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | Issue #28760: Clean up and fix comments in PyUnicode_AsUnicodeEscapeString().Serhiy Storchaka2016-11-211-10/+4
| | |/ / / / / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Xiang Zhang.
| * | | | | | | | | | | | | | | | Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString nowSerhiy Storchaka2016-11-161-0/+11
| | |_|_|_|_|_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | require ASCII right argument and assert this condition in debug build.
| * | | | | | | | | | | | | | | Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701).Serhiy Storchaka2016-11-161-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / / / / / | |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Issue #21449: Removed private function _PyUnicode_CompareWithId.Serhiy Storchaka2016-11-161-9/+0
| | |_|/ / / / / / / / / / / / | |/| | | | | | | | | | | | |
| * | | | | | | | | | | | | | Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-161-1177/+1279
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | |_|_|_|_|_|_|_|_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | | | | | | | | | | Closes #27781: Removes special cases for the experimental aspect of PEP 529Steve Dower2016-11-061-10/+1
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith2016-10-311-6/+32
| | | |_|_|_|_|_|_|_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | escapes. Backport to 3.6.