summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)Inada Naoki2020-06-171-0/+10
| | | | Co-authored-by: Kyle Stanley <aeros167@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-1635741: Port _gdbm module to multiphase initialization (GH-20920)Dong-hee Na2020-06-162-197/+280
|
* closes bpo-28557: error message for bad raw readinto (GH-7496)David Szotten2020-06-151-0/+9
| | | Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-40989: PyObject_INIT() becomes an alias to PyObject_Init() (GH-20901)Victor Stinner2020-06-152-22/+21
| | | | | | | | | | | | | | The PyObject_INIT() and PyObject_INIT_VAR() macros become aliases to, respectively, PyObject_Init() and PyObject_InitVar() functions. Rename _PyObject_INIT() and _PyObject_INIT_VAR() static inline functions to, respectively, _PyObject_Init() and _PyObject_InitVar(), and move them to pycore_object.h. Remove their return value: their return type becomes void. The _datetime module is now built with the Py_BUILD_CORE_MODULE macro defined. Remove an outdated comment on _Py_tracemalloc_config.
* bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)Victor Stinner2020-06-152-5/+4
| | | | | | | | | | On Windows, #include "pyerrors.h" no longer defines "snprintf" and "vsnprintf" macros. PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable behavior. Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf() calls with PyOS_vsnprintf().
* bpo-1635741: Port _dbm module to multiphase initialization (GH-20848)Dong-hee Na2020-06-152-147/+200
|
* bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)Niklas Fiekas2020-06-152-0/+41
| | | | | | | | | | In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This allows reconsidering bpo-29782. * Move the function to the new header. * Changed return type to match __builtin_clzl() and reviewed usage. * Use intrinsics where available. * Pick a fallback implementation suitable for inlining.
* bpo-40955: Fix memory leak in subprocess module (GH-20825)Christian Heimes2020-06-121-0/+1
| | | | | | | | | | ``` Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667) #1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774 #2 0xe0305b in cfunction_call Objects/methodobject.c:546 ``` Signed-off-by: Christian Heimes <christian@python.org>
* bpo-40950: Port nis module to multiphase initialization (GH-20811)Dong-hee Na2020-06-121-45/+103
|
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-113-1382/+0
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
* bpo-40947: getpath.c uses PyConfig.platlibdir (GH-20807)Victor Stinner2020-06-111-11/+20
| | | | | | | | | | | Followup of bpo-40854, there is one remaining usage of PLATLIBDIR which should be replaced by config->platlibdir. test_sys checks that sys.platlibdir attribute exists and is a string. Update Makefile: getpath.c and sysmodule.c no longer need PLATLIBDIR macro, PyConfig.platlibdir member is used instead. Co-authored-by: Sandro Mani <manisandro@gmail.com>
* bpo-39465: Use _PyInterpreterState_GET() (GH-20788)Victor Stinner2020-06-101-32/+25
| | | | | | | | | | | | Replace _PyThreadState_GET() with _PyInterpreterState_GET() in: * get_small_int() * gcmodule.c: add also get_gc_state() function * _PyTrash_deposit_object() * _PyTrash_destroy_chain() * warnings_get_state() * Py_GetRecursionLimit() Cleanup listnode.c: add 'parser' variable.
* bpo-40943: Replace PY_FORMAT_SIZE_T with "z" (GH-20781)Victor Stinner2020-06-104-23/+17
| | | | | | | The PEP 353, written in 2005, introduced PY_FORMAT_SIZE_T. Python no longer supports macOS 10.4 and Visual Studio 2010, but requires more recent macOS and Visual Studio versions. In 2020 with Python 3.10, it is now safe to use directly "%zu" to format size_t and "%zi" to format Py_ssize_t.
* Remove usesless function from csv module (GH-20762)Dong-hee Na2020-06-091-8/+2
|
* Add multicore support to deccheck.py. (GH-20731)Stefan Krah2020-06-081-21/+110
|
* bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var ↵Sandro Mani2020-06-081-10/+6
| | | | (GH-20605)
* bpo-29882: Add _Py_popcount32() function (GH-20518)Victor Stinner2020-06-084-4/+44
| | | | | | * Rename pycore_byteswap.h to pycore_bitutils.h. * Move popcount_digit() to pycore_bitutils.h as _Py_popcount32(). * _Py_popcount32() uses GCC and clang builtin function if available. * Add unit tests to _Py_popcount32().
* bpo-40898: Remove redundant if statements in tp_traverse (GH-20692)Hai Shi2020-06-074-13/+5
|
* Fix return type of test helper function heapctypewithbuffer_releasebuffer() ↵Rémi Lapeyre2020-06-071-1/+1
| | | | (GH-20685)
* bpo-40724: Support setting buffer slots from type specs (GH-20648)scoder2020-06-061-0/+47
| | | This is not part of the limited API but makes the buffer slots available for type specs.
* Refactor scripts in Tools/peg_generator/scripts (GH-20401)Lysandros Nikolaou2020-06-061-4/+12
|
* bpo-40867: Remove unused include from Module/_randommodule.c (GH-20635)Erlend Egeberg Aasland2020-06-051-1/+0
|
* bpo-40876: Clarify error message in the csv module (GH-20653)Ram Rachum2020-06-051-1/+1
|
* bpo-40874: Update to libmpdec-2.5.0 (GH-20652)Stefan Krah2020-06-0538-296/+502
|
* bpo-1635741: Port mmap module to multiphase initialization (GH-19459)Dong-hee Na2020-06-051-74/+80
|
* bpo-40521: Make context free list per-interpreter (GH-20644)Victor Stinner2020-06-051-4/+3
| | | | | | | | | Each interpreter now has its own context free list: * Move context free list into PyInterpreterState. * Add _Py_context_state structure. * Add tstate parameter to _PyContext_ClearFreeList() and _PyContext_Fini(). * Pass tstate to clear_freelists().
* bpo-40521: Make async gen free lists per-interpreter (GH-20643)Victor Stinner2020-06-051-1/+1
| | | | | | | | | Each interpreter now has its own asynchronous generator free lists: * Move async gen free lists into PyInterpreterState. * Move _PyAsyncGen_MAXFREELIST define to pycore_interp.h * Add _Py_async_gen_state structure. * Add tstate parameter to _PyAsyncGen_ClearFreeLists and _PyAsyncGen_Fini().
* bpo-40521: Make list free list per-interpreter (GH-20642)Victor Stinner2020-06-051-1/+1
| | | | | | | | | | | | Each interpreter now has its own list free list: * Move list numfree and free_list into PyInterpreterState. * Add _Py_list_state structure. * Add tstate parameter to _PyList_ClearFreeList() and _PyList_Fini(). * Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS". * _PyGC_Fini() clears gcstate->garbage list which can be stored in the list free list. Call _PyGC_Fini() before _PyList_Fini() to prevent leaking this list.
* bpo-40521: Make frame free list per-interpreter (GH-20638)Victor Stinner2020-06-041-1/+1
| | | | | | | | | | Each interpreter now has its own frame free list: * Move frame free list into PyInterpreterState. * Add _Py_frame_state structure. * Add tstate parameter to _PyFrame_ClearFreeList() and _PyFrame_Fini(). * Remove "#if PyFrame_MAXFREELIST > 0". * Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".
* bpo-40521: Make float free list per-interpreter (GH-20636)Victor Stinner2020-06-041-1/+1
| | | | | | | | Each interpreter now has its own float free list: * Move tuple numfree and free_list into PyInterpreterState. * Add _Py_float_state structure. * Add tstate parameter to _PyFloat_ClearFreeList() and _PyFloat_Fini().
* bpo-40521: Make tuple free list per-interpreter (GH-20247)Victor Stinner2020-06-041-1/+2
| | | | | | | | | | Each interpreter now has its own tuple free lists: * Move tuple numfree and free_list arrays into PyInterpreterState. * Define PyTuple_MAXSAVESIZE and PyTuple_MAXFREELIST macros in pycore_interp.h. * Add _Py_tuple_state structure. Pass it explicitly to tuple_alloc(). * Add tstate parameter to _PyTuple_ClearFreeList() * Each interpreter now has its own empty tuple singleton.
* bpo-40865: Remove unused insint() macro from hash modules (GH-20627)Erlend Egeberg Aasland2020-06-044-12/+0
| | | Automerge-Triggered-By: @tiran
* Remove unused ReaderObject_Check macro (#20614)Dong-hee Na2020-06-031-2/+0
|
* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)Victor Stinner2020-06-031-2/+12
| | | | | | | | | | | | my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for pending signals, rather calling PyOS_InterruptOccurred(). my_fgets() is called with the GIL released, whereas PyOS_InterruptOccurred() must be called with the GIL held. test_repl: use text=True and avoid SuppressCrashReport in test_multiline_string_parsing(). Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.
* bpo-32604: Fix reference leak in select module (GH-20600)Victor Stinner2020-06-031-2/+0
| | | | Fix reference leak in PyInit_select() of the select module: remove Py_INCREF(poll_Type).
* PyOS_AfterFork_Child() pass tstate to _PyEval_ReInitThreads() (GH-20598)Victor Stinner2020-06-021-2/+6
|
* PyOS_AfterFork_Child() uses PyStatus (GH-20596)Victor Stinner2020-06-022-8/+40
| | | | | | | | PyOS_AfterFork_Child() helper functions now return a PyStatus: PyOS_AfterFork_Child() is now responsible to handle errors. * Move _PySignal_AfterFork() to the internal C API * Add #ifdef HAVE_FORK on _PyGILState_Reinit(), _PySignal_AfterFork() and _PyInterpreterState_DeleteExceptMain().
* bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)Victor Stinner2020-06-011-2/+3
| | | | PyOS_InterruptOccurred() now fails with a fatal error if it is called with the GIL released.
* bpo-39943: Fix MSVC warnings in sre extension (GH-20508)Ammar Askar2020-06-012-3/+10
|
* bpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)Hai Shi2020-06-011-1/+3
|
* bpo-1635741: Port fcntl module to multiphase initialization (GH-20540)Dong-hee Na2020-06-011-22/+19
|
* bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)Christian Heimes2020-06-011-11/+45
| | | | | | | | | Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use ``no-deprecated`` and ``--api=1.1.0``. Note: Tests assume full OpenSSL API and fail with limited API. Signed-off-by: Christian Heimes <christian@python.org> Co-authored-by: Mark Wright <gienah@gentoo.org>
* bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)Zackery Spytz2020-05-301-0/+1
| | | | tup should be decrefed in the unlikely event of a PyList_New() failure.
* bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time ↵Petr Viktorin2020-05-281-3/+10
| | | | | | | (GH-20493) Recent changes to _datetimemodule broke compilation on mingw; see the comments in this change for details. FWIW, @corona10: this issue is why `PyType_FromModuleAndSpec` & friends take the `bases` argument at run time.
* bpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)Victor Stinner2020-05-281-47/+2
| | | | | | | | | On macOS, socket.getaddrinfo() no longer uses an internal lock to prevent race conditions when calling getaddrinfo(). getaddrinfo is thread-safe is macOS 10.5, whereas Python 3.9 requires macOS 10.6 or newer. The lock was also used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD older than 4.
* bpo-40792: Make the result of PyNumber_Index() always having exact type int. ↵Serhiy Storchaka2020-05-2824-112/+86
| | | | | | | | | | | | (GH-20443) Previously, the result could have been an instance of a subclass of int. Also revert bpo-26202 and make attributes start, stop and step of the range object having exact type int. Add private function _PyNumber_Index() which preserves the old behavior of PyNumber_Index() for performance to use it in the conversion functions like PyLong_AsLong().
* bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)Victor Stinner2020-05-272-14/+31
| | | | | | If ctypes fails to convert the result of a callback or if a ctypes callback function raises an exception, sys.unraisablehook is now called with an exception set. Previously, the error was logged into stderr by PyErr_Print().
* bpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336)YoSTEALTH2020-05-272-2/+7
|
* Fix compiler warnings in _zoneinfo.c (GH-20342)Pablo Galindo2020-05-271-30/+26
| | | | | | | ``` D:\a\cpython\cpython\Modules\_zoneinfo.c(903,52): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj] D:\a\cpython\cpython\Modules\_zoneinfo.c(904,44): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj] D:\a\cpython\cpython\Modules\_zoneinfo.c(1772,31): warning C4244: '=': conversion from 'ssize_t' to 'uint8_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj] ```
* bpo-40791: Use CRYPTO_memcmp() for compare_digest (#20456)Christian Heimes2020-05-273-1/+159
| | | | | | | | hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function when OpenSSL is available. Note: The _operator module is a builtin module. I don't want to add libcrypto dependency to libpython. Therefore I duplicated the wrapper function and added a copy to _hashopenssl.c.