summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35983: skip trashcan for subclasses (GH-11841)Jeroen Demeyer2019-05-107-95/+14
| | | | | Add new trashcan macros to deal with a double deallocation that could occur when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class and that base class uses the trashcan mechanism. Patch by Jeroen Demeyer.
* bpo-36869: fix warning of unused variables (GH-13182)Emmanuel Arias2019-05-101-1/+2
|
* Fix a possible crash due to PyType_FromSpecWithBases() (GH-10304)Zackery Spytz2019-05-091-0/+1
| | | | If the PyObject_MALLOC() call failed in PyType_FromSpecWithBases(), PyObject_Free() would be called on a static string in type_dealloc().
* closes bpo-36861: Update Unicode database to 12.1.0. (GH-13214)Benjamin Peterson2019-05-091-1/+1
| | | Adds ㋿.
* bpo-36793: Remove unneeded __str__ definitions. (GH-13081)Serhiy Storchaka2019-05-064-4/+4
| | | | Classes that define __str__ the same as __repr__ can just inherit it from object.
* bpo-36766: Typos in docs and code comments (GH-13116)penguindustin2019-05-061-1/+1
|
* bpo-36594: Fix incorrect use of %p in format strings (GH-12769)Zackery Spytz2019-05-063-9/+9
| | | In addition, fix some other minor violations of C99.
* Only count number of members once (#12691)Eddie Elizondo2019-05-061-0/+1
|
* bpo:34848 : Correct an incorrect docstring for range().index method (GH-9877)Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2019-05-031-1/+1
|
* bpo-36775: _PyCoreConfig only uses wchar_t* (GH-13062)Victor Stinner2019-05-022-73/+243
| | | | | | | | | | | | | | | | | _PyCoreConfig: Change filesystem_encoding, filesystem_errors, stdio_encoding and stdio_errors fields type from char* to wchar_t*. Changes: * PyInterpreterState: replace fscodec_initialized (int) with fs_codec structure. * Add get_error_handler_wide() and unicode_encode_utf8() helper functions. * Add error_handler parameter to unicode_encode_locale() and unicode_decode_locale(). * Remove _PyCoreConfig_SetString(). * Rename _PyCoreConfig_SetWideString() to _PyCoreConfig_SetString(). * Rename _PyCoreConfig_SetWideStringFromString() to _PyCoreConfig_DecodeLocale().
* bpo-36775: Add _PyUnicode_InitEncodings() (GH-13057)Victor Stinner2019-05-021-0/+97
| | | | | | Move get_codec_name() and initfsencoding() from pylifecycle.c to unicodeobject.c. Rename also "init" functions in pylifecycle.c.
* bpo-36775: Add _Py_FORCE_UTF8_FS_ENCODING macro (GH-13056)Victor Stinner2019-05-021-2/+2
| | | | | | | Add _Py_FORCE_UTF8_LOCALE and _Py_FORCE_UTF8_FS_ENCODING macros to avoid factorize "#if defined(__ANDROID__) || defined(__VXWORKS__)" and "#if defined(__APPLE__)". Cleanup also config_init_fs_encoding().
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-292-33/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993)Zackery Spytz2019-04-281-1/+3
| | | https://bugs.python.org/issue36745
* bpo-36669: add matmul support to weakref.proxy (GH-12932)Mark Dickinson2019-04-261-0/+4
|
* bpo-36642: make unicodedata const (GH-12855)Inada Naoki2019-04-161-2/+2
|
* bpo-36611: Disable serialno field of debug memory allocators (#12796)Victor Stinner2019-04-121-19/+54
| | | | | | | | | | | Omit serialno field from debug hooks on Python memory allocators to reduce the memory footprint by 5%. Enable tracemalloc to get the traceback where a memory block has been allocated when a fatal memory error is logged to decide where to put a breakpoint. Compile Python with PYMEM_DEBUG_SERIALNO defined to get back the field.
* bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)Victor Stinner2019-04-124-114/+139
| | | | | | Add a new _PyObject_CheckConsistency() function which can be used to help debugging. The function is available in release mode. Add a 'check_content' parameter to _PyDict_CheckConsistency().
* bpo-36549: str.capitalize now titlecases the first character instead of ↵Kingsley M2019-04-121-1/+1
| | | | uppercasing it (GH-12804)
* bpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792)Inada Naoki2019-04-122-35/+99
|
* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)Victor Stinner2019-04-112-8/+10
| | | | | Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD, 0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte patterns than Windows CRT debug malloc() and free().
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)Victor Stinner2019-04-112-25/+8
| | | | | | | | | Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline function. The function is now way more efficient, it became a simple comparison on integers, rather than a short loop. It detects also uninitialized bytes and "forbidden bytes" filled by debug hooks on memory allocators. Add unit tests on _PyObject_IsFreed().
* bpo-29202: improve dict iteration (GH-11900)Cheryl Sabella2019-04-051-9/+6
| | | Use fewer iterations instead of iterating over the whole entry table.
* bpo-36473: add maximum iteration check for dict .values() and .items() ↵Thomas Perl2019-04-021-0/+12
| | | | (GH-12619)
* fix confusing argument name in unicodeobject.c (GH-12653)Max Bernstein2019-04-021-2/+2
|
* bpo-36026: make descr error message consistent (GH-11930)Inada Naoki2019-04-011-14/+12
| | | | set.add(0) and set.add.__get__(0) now raise TypeError with same error message.
* bpo-24214: Fixed the UTF-8 incremental decoder. (GH-12603)Serhiy Storchaka2019-03-301-0/+3
| | | | The bug occurred when the encoded surrogate character is passed to the incremental decoder in two chunks.
* bpo-36452: dictiter: track maximum iteration count (GH-12596)Thomas Perl2019-03-281-0/+6
|
* bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)Eddie Elizondo2019-03-273-6/+10
| | | | | * Incref heap-allocated types in PyObject_Init * Add documentation and porting notes to What's New
* bpo-36433: fix confusing error messages in classmethoddescr_call (GH-12556)Inada Naoki2019-03-261-6/+4
| | | https://bugs.python.org/issue36433
* bpo-36218: Fix handling of heterogeneous values in list.sort (GH-12209)Rémi Lapeyre2019-03-251-11/+22
|
* bpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)Zackery Spytz2019-03-241-1/+3
|
* bpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)Zackery Spytz2019-03-221-1/+1
| | | | | If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(), _PyUnicodeWriter_Dealloc() will be called on an uninitialized _PyUnicodeWriter.
* bpo-36312: Fix decoders for some code pages. (GH-12369)Serhiy Storchaka2019-03-201-5/+16
|
* bpo-36365: Rewrite structseq_repr() using _PyUnicodeWriter (GH-12440)Victor Stinner2019-03-191-58/+68
| | | | | No longer limit repr(structseq) to 512 bytes. Use _PyUnicodeWriter for better performance and to write directly Unicode rather than encoding repr() value to UTF-8 and then decoding from UTF-8.
* bpo-36356: Release Unicode interned strings on Valgrind (#12431)Victor Stinner2019-03-191-15/+42
| | | | | | | | | | | When Python is compiled with Valgrind support, release Unicode interned strings at exit in _PyUnicode_Fini(). * Rename _Py_ReleaseInternedUnicodeStrings() to unicode_release_interned() and make it private. * unicode_release_interned() is now called from _PyUnicode_Fini(): it must be called with a running Python thread state for TRASHCAN, it cannot be called from pymain_free(). * Don't display statistics on interned strings at exit anymore
* bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)Victor Stinner2019-03-191-2/+11
| | | | | | | | Python initialization now fails if decoding pybuilddir.txt configuration file fails at startup. _PyPathConfig_Calculate() now reports memory allocation failure and decoding error on decoding pybuilddir.txt content from UTF-8/surrogateescape.
* bpo-36292: Mark unreachable code as such in long bitwise ops (GH-12333)stratakis2019-03-181-4/+2
|
* bpo-30040: optimize inserting into empty dict (GH-12307)Inada Naoki2019-03-181-2/+49
|
* bpo-36297: remove "unicode_internal" codec (GH-12342)Inada Naoki2019-03-181-102/+0
|
* bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as ↵Eric Snow2019-03-152-0/+310
| | | | necessary). (gh-12359)
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-1413-106/+723
| | | | (GH-12058)
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-133-4/+4
|
* bpo-30040: new empty dict uses key-sharing dict (GH-1080)Inada Naoki2019-03-121-4/+5
| | | | Sizeof new empty dict becomes 72 bytes from 240 bytes (amd64). It is same size to empty dict created by dict.clear().
* bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). ↵sth2019-03-101-1/+1
| | | | (GH-12252)
* closes bpo-33376: Update to Unicode 12.0.0. (GH-12256)Benjamin Peterson2019-03-101-912/+1067
|
* bpo-36142: Add _PyPreConfig_SetAllocator() (GH-12187)Victor Stinner2019-03-061-14/+0
| | | | | | | | | | | * _PyPreConfig_Write() now reallocates the pre-configuration with the new memory allocator. * It is no longer needed to force the "default raw memory allocator" to clear pre-configuration and core configuration. Simplify the code. * _PyPreConfig_Write() now does nothing if called after Py_Initialize(): no longer check if the allocator is the same. * Remove _PyMem_GetDebugAllocatorsName(): dev mode sets again allocator to "debug".
* bpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)Victor Stinner2019-03-051-0/+14
| | | | | The development mode now uses the effective name of the debug memory allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't change after setting the memory allocator.
* bpo-33012: Fix compilation warnings in memoryobject.c and ↵Stéphane Wirtel2019-03-051-1/+1
| | | | | | _collectionsmodule.c (GH-12179) Cast function pointers to (void(*)(void)) before casting to (PyCFunction) to make "warning: cast between incompatible function types" false alarm quiet.
* closes bpo-36188: Clean up 'unbound' method left-overs. (GH-12169)Martijn Pieters2019-03-051-18/+3
| | | | | | | | | | Methods are always bound, and `__self__` can no longer be `NULL` (`method_new()` and `PyMethod_New()` both explicitly check for this). Moreover, once a bound method is bound, it *stays* bound and won't be re-bound to something else, so the section in the datamodel that talks about accessing an methods in a different descriptor-binding context doesn't apply any more in Python 3.