summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-1635741: Port _thread to multiphase init (GH-23811)Victor Stinner2020-12-181-90/+221
| | | | | | | Port the _thread extension module to the multiphase initialization API (PEP 489) and convert its static types to heap types. Add a traverse function to the lock type, so the garbage collector can break reference cycles.
* bpo-40686: Fix compiler warnings on _zoneinfo.c (GH-23614)Victor Stinner2020-12-161-10/+4
| | | | | | | | "uint8_t day" is unsigned and so "day < 0" test is always true. Remove the test to fix the following warnings on Windows: modules\_zoneinfo.c(1224): warning C4068: unknown pragma modules\_zoneinfo.c(1225): warning C4068: unknown pragma modules\_zoneinfo.c(1227): warning C4068: unknown pragma
* bpo-1635741: Refactor _threadmodule.c (GH-23793)Victor Stinner2020-12-161-311/+226
| | | | | | | | | | | | | * Fix ExceptHookArgsType name: "_thread.ExceptHookArgs", instead of "_thread._ExceptHookArgs". * PyInit__thread() no longer intializes interp->num_threads to 0: it is already done in PyInterpreterState_New(). * Use PyModule_AddType(), Py_NewRef() and Py_XNewRef(). * Replace str_dict variable with _Py_IDENTIFIER(__dict__). * Remove assert(Py_IS_TYPE(obj, &Locktype)) from release_sentinel() to avoid having to retrive the type from this callback. * Add thread_bootstate_free() * Rename t_bootstrap() to thread_run() * bootstate structure: rename keyw member to kwargs
* bpo-42639: atexit._run_exitfuncs() uses sys.unraisablehook (GH-23779)Victor Stinner2020-12-151-35/+11
| | | | | | | | | | atexit._run_exitfuncs() now logs callback exceptions using sys.unraisablehook, rather than logging them directly into sys.stderr and raising the last exception. Run GeneralTest of test_atexit in a subprocess since it calls atexit._clear() which clears all atexit callbacks. _PyAtExit_Fini() sets state->callbacks to NULL.
* bpo-32381: pymain_run_file() uses PySys_FormatStderr() (GH-23778)Victor Stinner2020-12-151-17/+34
| | | | | If config->run_filename doesn't exist, log the error into sys.stderr using "%R" format, to escape properly unencodable characters (usually with backslashreplace).
* bpo-14935: Remove static state from the _csv module (GH-23224)Petr Viktorin2020-12-151-241/+303
| | | | | | | | Uses code from: https://github.com/python/cpython/pull/16078 Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com> Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com> Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-42639: Move atexit state to PyInterpreterState (GH-23763)Victor Stinner2020-12-151-97/+53
| | | | | | | | | * Add _PyAtExit_Call() function and remove pyexitfunc and pyexitmodule members of PyInterpreterState. The function logs atexit callback errors using _PyErr_WriteUnraisableMsg(). * Add _PyAtExit_Init() and _PyAtExit_Fini() functions. * Remove traverse, clear and free functions of the atexit module. Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-42639: atexit now logs callbacks exceptions (GH-23771)Victor Stinner2020-12-141-18/+35
| | | | | | | | | | | At Python exit, if a callback registered with atexit.register() fails, its exception is now logged. Previously, only some exceptions were logged, and the last exception was always silently ignored. Add _PyAtExit_Call() function and remove PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls directly _PyAtExit_Call(). The atexit module must now always be built as a built-in module.
* bpo-42639: Cleanup atexitmodule.c (GH-23770)Victor Stinner2020-12-141-126/+109
| | | | | | | | | * Rename "atexitmodule_state" to "struct atexit_state". * Rename "modstate" to "state". * Rename "self" parameter to "module". * test_atexit uses textwrap.dedent(). * Remove _Py_PyAtExit() function: inline it into atexit_exec(). * PyInterpreterState: rename pyexitfunc to atexit_func, rename pyexitmodule to atexit_module.
* bpo-32381: Add _PyRun_AnyFileObject() (GH-23723)Victor Stinner2020-12-091-27/+8
| | | | | | | | | | pymain_run_file() no longer encodes the filename: pass the filename as an object to the new _PyRun_AnyFileObject() function. Add new private functions: * _PyRun_AnyFileObject() * _PyRun_InteractiveLoopObject() * _Py_FdIsInteractive()
* bpo-32381: Add _PyRun_SimpleFileObject() (GH-23709)Victor Stinner2020-12-081-27/+14
| | | | pymain_run_startup() now pass the filename as a Python object to _PyRun_SimpleFileObject().
* bpo-42111: Make the xxlimited module an example of best extension module ↵Petr Viktorin2020-12-082-155/+525
| | | | | | | practices (GH-23226) - Copy existing xxlimited to xxlimited53 (named for the limited API version it uses) - Build both modules, both in debug and release - Test both modules
* bpo-42536: GC track recycled tuples (GH-23623)Brandt Bucher2020-12-052-0/+32
| | | | | | | | | | | | | | | | Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector: - collections.OrderedDict.items - dict.items - enumerate - functools.reduce - itertools.combinations - itertools.combinations_with_replacement - itertools.permutations - itertools.product - itertools.zip_longest - zip Previously, they could have become untracked by a prior garbage collection.
* bpo-42262: Py_NewRef() casts its argument to PyObject* (GH-23626)Victor Stinner2020-12-031-1/+31
| | | Write also unit tests on Py_NewRef() and Py_XNewRef().
* bpo-41625: Do not add os.splice on AIX due to compatibility issues (GH-23608)Pablo Galindo2020-12-022-4/+4
|
* Correct return type in Modules/_ssl.c::sslmodule_legacy (GH-23609)Pablo Galindo2020-12-021-1/+1
|
* bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)Victor Stinner2020-12-0130-46/+46
| | | | | | | | | No longer use deprecated aliases to functions: * Replace PyObject_MALLOC() with PyObject_Malloc() * Replace PyObject_REALLOC() with PyObject_Realloc() * Replace PyObject_FREE() with PyObject_Free() * Replace PyObject_Del() with PyObject_Free() * Replace PyObject_DEL() with PyObject_Free()
* bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)Victor Stinner2020-12-0112-61/+62
| | | | | | | | | | | No longer use deprecated aliases to functions: * Replace PyMem_MALLOC() with PyMem_Malloc() * Replace PyMem_REALLOC() with PyMem_Realloc() * Replace PyMem_FREE() with PyMem_Free() * Replace PyMem_Del() with PyMem_Free() * Replace PyMem_DEL() with PyMem_Free() Modify also the PyMem_DEL() macro to use directly PyMem_Free().
* bpo-38200: Add itertools.pairwise() (GH-23549)Raymond Hettinger2020-12-012-2/+168
|
* bpo-31904: Support signal module on VxWorks (GH-23391)pxinwr2020-11-301-0/+4
|
* bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)Serhiy Storchaka2020-11-222-14/+2
|
* bpo-1635741: Port select module to multiphase init (GH-23409)Christian Heimes2020-11-212-85/+108
|
* bpo-1635741: Port _posixsubprocess module to multiphase init (GH-23406)Christian Heimes2020-11-211-35/+42
|
* bpo-42232: mmap module add Darwin specific madvise options. (GH-23076)David CARLIER2020-11-211-0/+8
|
* bpo-40791: Make compare_digest more constant-time. (GH-20444)Devin Jeanpierre2020-11-211-1/+1
| | | | | | | | * bpo-40791: Make compare_digest more constant-time. The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization. (This is change #1 from https://bugs.python.org/issue40791 .)
* bpo-1635741: Convert _sre types to heap types and establish module state ↵Erlend Egeberg Aasland2020-11-202-483/+368
| | | | (PEP 384) (GH-23393)
* bpo-1635741: Enhance _datetime error handling (GH-23139)Mohamed Koubaa2020-11-201-117/+103
|
* bpo-42333: Port _ssl extension module to heap types (GH-23392)Christian Heimes2020-11-202-336/+362
| | | All types in _ssl module are now heap types.
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-202-17/+13
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Port _posixshmem extension module to multiphase initialization ↵Christian Heimes2020-11-191-13/+9
| | | | | (GH-23404) Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Fix _struct for build bot error (GH-23402)Dong-hee Na2020-11-191-1/+1
| | | Automerge-Triggered-By: GH:tiran
* bpo-1635741: Port gc module to multiphase initialization (GH-23377)Christian Heimes2020-11-191-45/+41
| | | | | Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran
* bpo-1635741: Port _struct to multiphase initialization (GH-23398)Christian Heimes2020-11-192-238/+270
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Port spwd to multiphase initialization (GH-23390)Christian Heimes2020-11-191-27/+57
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Port _queue to multiphase initialization (GH-23376)Christian Heimes2020-11-191-37/+36
| | | | | Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran
* bpo-1635741: Port grp and pwd to multiphase initialization (GH-23360)Christian Heimes2020-11-192-66/+70
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Port _random to multiphase initialization (GH-23359)Christian Heimes2020-11-191-45/+49
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-42375: subprocess DragonFlyBSD build update. (GH-23320)David CARLIER2020-11-191-4/+4
| | | Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.
* bpo-1635741: Convert _imp to multi-phase init (GH-23378)Victor Stinner2020-11-181-1/+1
| | | | | | | | | | | | Convert the _imp extension module to the multi-phase initialization API (PEP 489). * Add _PyImport_BootstrapImp() which fix a bootstrap issue: import the _imp module before importlib is initialized. * Add create_builtin() sub-function, used by _imp_create_builtin(). * Initialize PyInterpreterState.import_func earlier, in pycore_init_builtins(). * Remove references to _PyImport_Cleanup(). This function has been renamed to finalize_modules() and moved to pylifecycle.c.
* bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)Victor Stinner2020-11-181-0/+25
| | | | | | | | | This change partically reverts commit ad3252bad905d41635bcbb4b76db30d570cf0087 and the commit fe2978b3b940fe2478335e3a2ca5ad22338cdf9c. Many third party C extension modules rely on the ability of using Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an object type using: "Py_SIZE(obj) = size;".
* bpo-1635741: Port _hashlib to multiphase initialization (GH-23358)Christian Heimes2020-11-181-36/+2
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Port symtable module to multiphase initialization (GH-23361)Christian Heimes2020-11-181-45/+49
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-41713: Port _signal module to multi-phase init (GH-23355)Victor Stinner2020-11-171-16/+17
| | | | | | Port the _signal extension module to the multi-phase initialization API (PEP 489). Co-Authored-By: Mohamed Koubaa <koubaa.m@gmail.com>
* bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353)Victor Stinner2020-11-171-0/+23
|
* bpo-41625: Add a guard for Linux for splice() constants in the os module ↵Pablo Galindo2020-11-171-1/+1
| | | | (GH-23350)
* bpo-41686: Refactor signal_exec() (GH-23346)Victor Stinner2020-11-171-158/+125
| | | | | | * Add signal_add_constants() function and add ADD_INT_MACRO macro. * The Python SIGINT handler is now installed at the end of signal_exec(). * Use Py_NewRef().
* bpo-41686: Always create the SIGINT event on Windows (GH-23344)Victor Stinner2020-11-171-53/+87
| | | | | | | | | | | | | | bpo-41686, bpo-41713: On Windows, the SIGINT event, _PyOS_SigintEvent(), is now created even if Python is configured to not install signal handlers (PyConfig.install_signal_handlers=0 or Py_InitializeEx(0)). Changes: * Move global variables initialization from signal_exec() to _PySignal_Init() to clarify that they are global variables cleared by _PySignal_Fini(). * _PySignal_Fini() now closes sigint_event. * IntHandler is no longer a global variable.
* bpo-42264: Deprecate sqlite3.OptimizedUnicode (GH-23163)Erlend Egeberg Aasland2020-11-171-9/+0
|
* bpo-41713: Remove PyOS_InitInterrupts() function (GH-23342)Victor Stinner2020-11-171-12/+25
| | | | | | | Remove the undocumented PyOS_InitInterrupts() C function. * Rename PyOS_InitInterrupts() to _PySignal_Init(). It now installs other signal handlers, not only SIGINT. * Rename PyOS_FiniInterrupts() to _PySignal_Fini()
* bpo-41861, _sqlite3 : Add NEWS entry and rename variables (GH-23337)Erlend Egeberg Aasland2020-11-171-8/+8
|