summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35091: Objects/listobject.c: Replace overflow checks in gallop fu… ↵Alexey Izbyshev2019-05-231-8/+4
| | | | | | | | | | | | | | | | (GH-10202) …nctions with asserts The actual overflow can never happen because of the following: * The size of a list can't be greater than PY_SSIZE_T_MAX / sizeof(PyObject*). * The size of a pointer on all supported plaftorms is at least 4 bytes. * ofs is positive and less than the list size at the beginning of each iteration. https://bugs.python.org/issue35091
* bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381)Jeroen Demeyer2019-05-221-5/+12
|
* closes bpo-36951: Correct some types in the type_members struct in ↵Zackery Spytz2019-05-201-3/+3
| | | | typeobject.c. (GH-13403)
* bpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)Serhiy Storchaka2019-05-192-30/+77
|
* Fix couple of dead code paths (GH-7418)David Carlier2019-05-172-3/+0
|
* bpo-36763: Add _PyInitError functions (GH-13395)Victor Stinner2019-05-172-0/+2
| | | | | | | | | | | | | | | * Add _PyInitError functions: * _PyInitError_Ok() * _PyInitError_Error() * _PyInitError_NoMemory() * _PyInitError_Exit() * _PyInitError_IsError() * _PyInitError_IsExit() * _PyInitError_Failed() * frozenmain.c and _testembed.c now use functions rather than macros. * Move _Py_INIT_xxx() macros to the internal API. * Move _PyWstrList_INIT macro to the internal API.
* bpo-36763: Add PyMemAllocatorName (GH-13387)Victor Stinner2019-05-171-14/+59
| | | | | | | | | | | | | | * Add PyMemAllocatorName enum * _PyPreConfig.allocator type becomes PyMemAllocatorName, instead of char* * Remove _PyPreConfig_Clear() * Add _PyMem_GetAllocatorName() * Rename _PyMem_GetAllocatorsName() to _PyMem_GetCurrentAllocatorName() * Remove _PyPreConfig_SetAllocator(): just call _PyMem_SetupAllocators() directly, we don't have do reallocate the configuration with the new allocator anymore! * _PyPreConfig_Write() parameter becomes const, as it should be in the first place!
* Fix typo in _PyMethodDef_RawFastCallKeywords error message (GH-13343)Jeroen Demeyer2019-05-171-1/+1
|
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Zackery Spytz2019-05-174-4/+8
| | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
* bpo-36900: Replace global conf vars with config (GH-13299)Victor Stinner2019-05-143-7/+15
| | | | | | Replace global configuration variables with core_config read from the current interpreter. Cleanup dynload_hpux.c.
* bpo-27987: pymalloc: align by 16bytes on 64bit platform (GH-12850)Inada Naoki2019-05-141-0/+6
|
* 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
|