summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40077: Remove redundant cast in json module (GH-19438)Hai Shi2020-04-091-2/+2
|
* bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190)Zackery Spytz2020-04-091-0/+3
| | | Co-Authored-By: Stefan Tatschner <stefan@rumpelsepp.org>
* bpo-40082: trip_signal() uses the main interpreter (GH-19441)Victor Stinner2020-04-081-15/+12
| | | | | | | | | | | | | | | | | | | | | | Fix the signal handler: it now always uses the main interpreter, rather than trying to get the current Python thread state. The following function now accepts an interpreter, instead of a Python thread state: * _PyEval_SignalReceived() * _Py_ThreadCanHandleSignals() * _PyEval_AddPendingCall() * COMPUTE_EVAL_BREAKER() * SET_GIL_DROP_REQUEST(), RESET_GIL_DROP_REQUEST() * SIGNAL_PENDING_CALLS(), UNSIGNAL_PENDING_CALLS() * SIGNAL_PENDING_SIGNALS(), UNSIGNAL_PENDING_SIGNALS() * SIGNAL_ASYNC_EXC(), UNSIGNAL_ASYNC_EXC() Py_AddPendingCall() now uses the main interpreter if it fails to the current Python thread state. Convert _PyThreadState_GET() and PyInterpreterState_GET_UNSAFE() macros to static inline functions.
* bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)Victor Stinner2020-04-073-6/+6
| | | | | | | | | | | | The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the PyObject_NewVar() macro, to hide implementation details. They no longer access directly the PyTypeObject.tp_basicsize member. Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from the limited C API. Replace PyObject_NEW() with PyObject_New() and replace PyObject_NEW_VAR() with PyObject_NewVar().
* bpo-39481: Make os.DirEntry generic (GH-19415)Batuhan Taşkaya2020-04-071-0/+2
|
* bpo-40089: Add _at_fork_reinit() method to locks (GH-19195)Victor Stinner2020-04-072-15/+55
| | | | | | | | | | | | | | | Add a private _at_fork_reinit() method to _thread.Lock, _thread.RLock, threading.RLock and threading.Condition classes: reinitialize the lock after fork in the child process; reset the lock to the unlocked state. Rename also the private _reset_internal_locks() method of threading.Event to _at_fork_reinit(). * Add _PyThread_at_fork_reinit() private function. It is excluded from the limited C API. * threading.Thread._reset_internal_locks() now calls _at_fork_reinit() on self._tstate_lock rather than creating a new Python lock object.
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-072-0/+8
| | | | | | | | | | | | This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.
* bpo-40149: Implement traverse in _abc._abc_data (GH-19412)Victor Stinner2020-04-071-4/+22
| | | Implement traverse and clear slots in _abc._abc_data type.
* bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)Victor Stinner2020-04-062-2/+3
| | | | | | | | Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide implementation details: the macro accessed directly to the PyTypeObject.tp_weaklistoffset member. Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the internal C API.
* bpo-40190: Add support for _SC_AIX_REALMEM in sysconf (GH-19380)Batuhan Taşkaya2020-04-051-0/+3
|
* bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)Hai Shi2020-04-041-0/+1
| | | | Fix possible refleaks in _json module, memo of PyScannerObject should be traversed.
* bpo-1635741: Fix refleak in _locale init error handling (GH-19307)Hai Shi2020-04-021-15/+26
|
* bpo-1635741: Port resource extension module to multiphase initialization ↵Hai Shi2020-04-021-53/+72
| | | | | (PEP 489) (GH-19252) Fix also reference leaks on error.
* bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)Victor Stinner2020-04-012-1/+140
| | | | | | | | | | | | | | Add os.waitstatus_to_exitcode() function to convert a wait status to an exitcode. Suggest waitstatus_to_exitcode() usage in the documentation when appropriate. Use waitstatus_to_exitcode() in: * multiprocessing, os, subprocess and _bootsubprocess modules; * test.support.wait_process(); * setup.py: run_command(); * and many tests.
* bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)Paulo Henrique Silva2020-04-011-1/+4
| | | | | | | | | | | | | | | | | Changes on 7dd549eb0893 made _functools compatible with PEP-489 and we could have multiple modules instances loaded. But, right now there is no way to make `kwd_mark` global into a per module instance variable. kwd_mark is used on lru_cache_new which does not have a reference to a PyModule*, necessary to use PyModule_GetState. PEP-573 will solve this problem and will allow us to move the global state to per-module data and properly clear the state when unloading a module instance. This change temporarily disable cleaning of kwd_mark to avoid NULL pointer dereference if we clear kwd_mark and other module instances still alive use it.
* bpo-1635741: Port math module to multiphase initialization (GH-19243)Dong-hee Na2020-03-311-25/+33
|
* bpo-1635741: Port _uuid module to multiphase initialization (GH-19242)Dong-hee Na2020-03-311-19/+22
|
* bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)Steve Dower2020-03-311-3/+4
|
* bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202)Dong-hee Na2020-03-301-30/+75
| | | | | | | Replace statically allocated types with heap allocated types: use PyType_FromSpec(). Add a module state to store the _abc_data_type. Add traverse, clear and free functions to the module.
* bpo-40024: Update _elementtree to use PyModule_AddType() (GH-19205)Dong-hee Na2020-03-291-8/+14
|
* bpo-40077: Convert _json module to use PyType_FromSpec() (GH-19177)Dong-hee Na2020-03-271-157/+130
| | | | | | | Replace statically allocated types with heap allocated types: use PyType_FromSpec(). Add a module state to store the Scanner and Encoder types. Add traverse, clear and free functions to the module.
* bpo-38644: Pass tstate explicitly in signalmodule.c (GH-19184)Victor Stinner2020-03-261-63/+89
| | | | PyOS_InterruptOccurred() now checks _Py_ThreadCanHandleSignals() before checking if SIGINT is tripped.
* bpo-40071: Fix refleak in _functools module (GH19172)Paulo Henrique Silva2020-03-261-2/+4
|
* bpo-39947: Add PyThreadState_GetID() function (GH-19163)Victor Stinner2020-03-251-2/+3
| | | | Add PyThreadState_GetID() function: get the unique identifier of a Python thread state.
* bpo-39947: Add _PyThreadState_GetDict() function (GH-19160)Victor Stinner2020-03-251-2/+3
|
* bpo-39947: Use PyThreadState_GetFrame() (GH-19159)Victor Stinner2020-03-252-4/+6
| | | | | _tracemalloc.c and _xxsubinterpretersmodule.c use PyThreadState_GetFrame() and PyThreadState_GetInterpreter() to no longer depend on the PyThreadState structure.
* bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)Victor Stinner2020-03-251-5/+4
|
* Use calloc-based functions, not malloc. (GH-19152)Andy Lester2020-03-255-22/+9
|
* bpo-1635741: Port _functools module to multiphase initialization (PEP 489) ↵Paulo Henrique Silva2020-03-251-28/+32
| | | | (GH-19151)
* bpo-1635741: Port operator module to multiphase initialization (PEP 489) ↵Paulo Henrique Silva2020-03-251-23/+26
| | | | (GH-19150)
* bpo-40024: Update C extension modules to use PyModule_AddType() (GH-19119)Dong-hee Na2020-03-2412-134/+67
| | | | | | Update _asyncio, _bz2, _csv, _curses, _datetime, _io, _operator, _pickle, _queue, blake2, multibytecodec and overlapped C extension modules to use PyModule_AddType().
* bpo-1635741: Port _weakref extension module to multiphase initialization ↵Victor Stinner2020-03-241-21/+37
| | | | | (PEP 489) (GH-19140) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-40014: Fix os.getgrouplist() (GH-19126)Victor Stinner2020-03-241-22/+25
| | | | | | | | Fix os.getgrouplist(): if getgrouplist() function fails because the group list is too small, retry with a larger group list. On failure, the glibc implementation of getgrouplist() sets ngroups to the total number of groups. For other implementations, double the group list size.
* bpo-39689: Do not use native packing for format "?" with standard size ↵Stefan Krah2020-03-241-0/+3
| | | | (GH-18969)
* closes bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096)Russell Owen2020-03-241-0/+5
| | | Co-authored-by: Benjamin Peterson <benjamin@python.org>
* Revert "bpo-1635741: Port _weakref extension module to multiphase ↵Victor Stinner2020-03-231-37/+21
| | | | | | initialization (PEP 489) (GH-19084)" (#19128) bpo-1635741, bpo-40050: This reverts commit 8334f30a74abcf7e469b901afc307887aa85a888.
* bpo-40036: Deleting duplicates in itertoolsmodule.c (GH-18958)AlphaHot2020-03-231-26/+0
|
* bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)Victor Stinner2020-03-231-0/+19
| | | | | On macOS, getgrouplist() returns a non-zero value without setting errno if the group list is too small. Double the list size and call it again in this case.
* bpo-1635741: Port time module to multiphase initialization (PEP 489) (GH-19107)Paulo Henrique Silva2020-03-231-51/+52
|
* bpo-40024: Add PyModule_AddType() helper function (GH-19088)Dong-hee Na2020-03-224-41/+13
|
* bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. ↵Serhiy Storchaka2020-03-211-7/+22
| | | | (GH-18942)
* bpo-40010: COMPUTE_EVAL_BREAKER() checks for subinterpreter (GH-19087)Victor Stinner2020-03-201-17/+12
| | | | | | | | | COMPUTE_EVAL_BREAKER() now also checks if the Python thread state belongs to the main interpreter. Don't break the evaluation loop if there are pending signals but the Python thread state it belongs to a subinterpeter. * Add _Py_IsMainThread() function. * Add _Py_ThreadCanHandleSignals() function.
* bpo-1635741: Port _weakref extension module to multiphase initialization ↵Hai Shi2020-03-201-21/+37
| | | | (PEP 489) (GH-19084)
* bpo-39824: Convert PyModule_GetState() to get_module_state() (GH-19076)Hai Shi2020-03-192-8/+8
| | | Automerge-Triggered-By: @vstinner
* bpo-1635741: Port _collections module to multiphase initialization (GH-19074)Dong-hee Na2020-03-191-42/+42
|
* bpo-39984: Move pending calls to PyInterpreterState (GH-19066)Victor Stinner2020-03-191-2/+2
| | | | | | | | | | | | | | | | | If Py_AddPendingCall() is called in a subinterpreter, the function is now scheduled to be called from the subinterpreter, rather than being called from the main interpreter. Each subinterpreter now has its own list of scheduled calls. * Move pending and eval_breaker fields from _PyRuntimeState.ceval to PyInterpreterState.ceval. * new_interpreter() now calls _PyEval_InitThreads() to create pending calls lock. * Fix Py_AddPendingCall() for subinterpreters. It now calls _PyThreadState_GET() which works in a subinterpreter if the caller holds the GIL, and only falls back on PyGILState_GetThisThreadState() if _PyThreadState_GET() returns NULL.
* Remove unused variable to fix compiler warning in _threadmodule.c (GH-19064)Pablo Galindo2020-03-181-2/+0
|
* bpo-39984: trip_signal() uses PyGILState_GetThisThreadState() (GH-19061)Victor Stinner2020-03-181-5/+9
| | | | | | | | | | | bpo-37127, bpo-39984: * trip_signal() and Py_AddPendingCall() now get the current Python thread state using PyGILState_GetThisThreadState() rather than _PyRuntimeState_GetThreadState() to be able to get it even if the GIL is released. * _PyEval_SignalReceived() now expects tstate rather than ceval. * Remove ceval parameter of _PyEval_AddPendingCall(): ceval is now get from tstate parameter.
* bpo-1635741: Port _heapq module to multiphase initialization (GH19057)Dong-hee Na2020-03-181-12/+19
|
* bpo-39984: _PyThreadState_DeleteCurrent() takes tstate (GH-19051)Victor Stinner2020-03-181-1/+1
| | | | | | | | | | * _PyThreadState_DeleteCurrent() now takes tstate rather than runtime. * Add ensure_tstate_not_null() helper to pystate.c. * Add _PyEval_ReleaseLock() function. * _PyThreadState_DeleteCurrent() now calls _PyEval_ReleaseLock(tstate) and frees PyThreadState memory after this call, not before. * PyGILState_Release(): rename "tcur" variable to "tstate".