summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-47164: Add _PyASCIIObject_CAST() macro (GH-32191)Victor Stinner2022-03-311-1/+1
| | | | | | | | | | | | Add macros to cast objects to PyASCIIObject*, PyCompactUnicodeObject* and PyUnicodeObject*: _PyASCIIObject_CAST(), _PyCompactUnicodeObject_CAST() and _PyUnicodeObject_CAST(). Using these new macros make the code more readable and check their argument with: assert(PyUnicode_Check(op)). Remove redundant assert(PyUnicode_Check(op)) in macros using directly or indirectly these new CAST macros. Replacing existing casts with these macros.
* bpo-46007: Exclude PyUnicode_CHECK_INTERNED() from limited C API (GH-29987)Victor Stinner2021-12-091-4/+0
| | | | | | | Exclude the PyUnicode_CHECK_INTERNED() macro from the limited C API, because it uses the PyASCIIObject structure which is excluded from the limited C API. Automerge-Triggered-By: GH:encukou
* bpo-45434: Remove useless space in includes (GH-28963)Victor Stinner2021-10-141-1/+1
| | | Micro-optimize spaces!
* bpo-45434: bytearrayobject.h no longer includes <stdarg.h> (GH-28913)Victor Stinner2021-10-131-1/+1
| | | | bytearrayobject.h and _lzmamodule.c don't use va_list and so don't need to include <stdarg.h>.
* bpo-41784: make PyUnicode_AsUTF8AndSize part of the limited API (GH-22252)Alex Gaynor2020-10-191-0/+17
|
* bpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486)Victor Stinner2020-10-021-1/+4
| | | | The PyUnicode_InternImmortal() function is now deprecated and will be removed in Python 3.12: use PyUnicode_InternInPlace() instead.
* bpo-39573: Add Py_IS_TYPE() function (GH-18488)Dong-hee Na2020-02-131-1/+1
| | | Co-Author: Neil Schemenauer <nas-github@arctrix.com>
* bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)Victor Stinner2019-11-231-11/+0
| | | | Remove PyUnicode_ClearFreeList() function: the Unicode free list has been removed in Python 3.3.
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)Victor Stinner2019-10-071-10/+0
| | | | | | | | | | | | | | | | | | | | | bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is now also available in release mode. For example, it can be used to debug a crash in the visit_decref() function of the GC. Modify the following functions to also work in release mode: * _PyDict_CheckConsistency() * _PyObject_CheckConsistency() * _PyType_CheckConsistency() * _PyUnicode_CheckConsistency() Other changes: * _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL (equals to 0). * _PyBytesWriter_CheckConsistency() now returns 1 and is only used with assert(). * Reorder _PyObject_Dump() to write safe fields first, and only attempt to render repr() at the end.
* bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980)Zackery Spytz2019-05-281-10/+10
|
* bpo-35134: Create Include/cpython/unicodeobject.h (GH-10680)Victor Stinner2018-11-261-1286/+6
| | | | Move unicodeobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/unicodeobject.h header file.
* bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623)Victor Stinner2018-11-261-3/+3
| | | | | | | | | | | | Fix str.format(), float.__format__() and complex.__format__() methods for non-ASCII decimal point when using the "n" formatter. Changes: * Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires a _PyUnicodeWriter object for the buffer and a Python str object for digits. * Rename FILL() macro to unicode_fill(), convert it to static inline function, add "assert(0 <= start);" and rework its code.
* bpo-35059: Add _PyObject_CAST() macro (GH-10645)Victor Stinner2018-11-221-3/+3
| | | | Add _PyObject_CAST() and _PyVarObject_CAST() macros to cast argument to PyObject* and PyVarObject* properly.
* bpo-29240: Fix locale encodings in UTF-8 Mode (#5170)Victor Stinner2018-01-151-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Modify locale.localeconv(), time.tzname, os.strerror() and other functions to ignore the UTF-8 Mode: always use the current locale encoding. Changes: * Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx(). On decoding or encoding error, they return the position of the error and an error message which are used to raise Unicode errors in PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale(). * Replace _Py_DecodeCurrentLocale() with _Py_DecodeLocaleEx(). * PyUnicode_DecodeLocale() now uses _Py_DecodeLocaleEx() for all cases, especially for the strict error handler. * Add _Py_DecodeUTF8Ex(): return more information on decoding error and supports the strict error handler. * Rename _Py_EncodeUTF8_surrogateescape() to _Py_EncodeUTF8Ex(). * Replace _Py_EncodeCurrentLocale() with _Py_EncodeLocaleEx(). * Ignore the UTF-8 mode to encode/decode localeconv(), strerror() and time zone name. * Remove PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and PyUnicode_EncodeLocale() now ignore the UTF-8 mode: always use the "current" locale. * Remove _PyUnicode_DecodeCurrentLocale(), _PyUnicode_DecodeCurrentLocaleAndSize() and _PyUnicode_EncodeCurrentLocale().
* bpo-29240: Ignore UTF-8 Mode in time module (#5148)Victor Stinner2018-01-111-0/+4
| | | | | | time.strftime() must use the current LC_CTYPE encoding, not UTF-8 if the UTF-8 mode is enabled. Add _PyUnicode_DecodeCurrentLocale() function.
* bpo-29240: readline now ignores the UTF-8 Mode (#5145)Victor Stinner2018-01-101-0/+10
| | | | | | | | | | | | Add new fuctions ignoring the UTF-8 mode: * _Py_DecodeCurrentLocale() * _Py_EncodeCurrentLocale() * _PyUnicode_DecodeCurrentLocaleAndSize() * _PyUnicode_EncodeCurrentLocale() Modify the readline module to use these functions. Re-enable test_readline.test_nonascii().
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-151-1/+1
| | | | arguments. (#4746)
* bpo-31979: Simplify transforming decimals to ASCII (#4336)Serhiy Storchaka2017-11-131-9/+7
| | | | | in int(), float() and complex() parsers. This also speeds up parsing non-ASCII numbers by around 20%.
* remove support for BSD/OS (closes bpo-31624) (#3812)Benjamin Peterson2017-09-291-4/+0
|
* Spelling fixes (#2902)Ville Skyttä2017-08-031-1/+1
|
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-281-3/+7
| | | | | | | Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
* bpo-29941: Assert fixes (#886)T. Wouters2017-03-311-0/+4
| | | | | | | | Make a non-Py_DEBUG, asserts-enabled build of CPython possible. This means making sure helper functions are defined when NDEBUG is not defined, not just when Py_DEBUG is defined. Also fix a division-by-zero in obmalloc.c that went unnoticed because in Py_DEBUG mode, elsize is never zero.
* bpo-28749: Fixed the documentation of the mapping codec APIs. (#487)Serhiy Storchaka2017-03-191-27/+18
| | | Added the documentation for PyUnicode_Translate().
* 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 *".
* Issue #29058: All stable API extensions added after Python 3.2 are nowSerhiy Storchaka2016-12-271-0/+18
|\ | | | | | | | | available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.
| * Issue #29058: All stable API extensions added after Python 3.2 are nowSerhiy Storchaka2016-12-271-0/+18
| | | | | | | | | | available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.
* | Issue #29009: Merge 3.6.Xiang Zhang2016-12-191-4/+0
|\ \ | |/
| * Issue #29009: Merge 3.5.Xiang Zhang2016-12-191-4/+0
| |\
| | * Issue #29009: Remove outdated doc of PyUnicode_RichCompare.Xiang Zhang2016-12-191-4/+0
| | |
* | | Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-1/+1
|\ \ \ | |/ /
| * | Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-1/+1
| |\ \ | | |/
| | * Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-1/+1
| | |
* | | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-201-32/+36
|/ / | | | | | | functions.
* | Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString nowSerhiy Storchaka2016-11-161-2/+2
| | | | | | | | require ASCII right argument and assert this condition in debug build.
* | 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-0/+19
|\ \ | |/ | | | | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
| * Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-161-0/+19
| | | | | | | | | | | | 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/+11
|\ \ | |/ | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-0/+11
| | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith2016-10-311-0/+11
| | | | | | | | escapes. Backport to 3.6.
* | Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),Serhiy Storchaka2016-10-271-8/+25
| | | | | | | | | | PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and PyUnicode_AsEncodedUnicode().
* | Issue #28295: Fixed the documentation and added tests for PyUnicode_AsUCS4().Serhiy Storchaka2016-10-021-1/+1
|\ \ | |/ | | | | Original patch by Xiang Zhang.
| * Issue #28295: Fixed the documentation and added tests for PyUnicode_AsUCS4().Serhiy Storchaka2016-10-021-1/+1
| | | | | | | | Original patch by Xiang Zhang.
* | Issue #28139: Merge indentation fixes from 3.5 into 3.6Martin Panter2016-09-171-1/+1
|\ \ | |/
| * Issue #28139: Fix messed up indentationMartin Panter2016-09-171-1/+1
| | | | | | | | | | Also update the classmethod and staticmethod doc strings and comments to match the RST documentation.
* | Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly ↵Christian Heimes2016-09-131-1/+1
| | | | | | | | optimize memcpy().
* | Issue #26900: Excluded underscored names and other private API from limited API.Serhiy Storchaka2016-09-111-0/+2
| |
* | simplify Py_UCSN definitions with stdint typesBenjamin Peterson2016-09-081-15/+3
| |
* | Issue #27781: Change file system encoding on Windows to UTF-8 (PEP 529)Steve Dower2016-09-081-6/+2
| |
* | Issue #27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec ↵Steve Dower2016-09-071-1/+1
| | | | | | | | lookup