summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35431: Implemented math.comb (GH-11414)Yash Aggarwal2019-06-012-1/+171
|
* bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)Eric Snow2019-06-011-1/+1
| | | https://bugs.python.org/issue36818
* bpo-26826: Expose copy_file_range in the os module (GH-7255)Pablo Galindo2019-05-312-1/+178
|
* bpo-26835: Add file sealing constants to fcntl (GH-13694)Christian Heimes2019-05-311-1/+9
| | | Co-authored-by: nanjekyejoannah <nanjekyejoannah@gmail.com>
* bpo-36379: __ipow__ must be a ternaryfunc, not a binaryfunc (GH-13546)Zackery Spytz2019-05-311-0/+26
| | | | | | | If a type's __ipow__ method was implemented in C, attempting to use the *modulo* parameter would cause crashes. https://bugs.python.org/issue36379
* bpo-34271: Add ssl debugging helpers (GH-10031)Christian Heimes2019-05-312-11/+306
| | | | | | | | | | | The ssl module now can dump key material to a keylog file and trace TLS protocol messages with a tracing callback. The default and stdlib contexts also support SSLKEYLOGFILE env var. The msg_callback and related enums are private members. The feature is designed for internal debugging and not for end users. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. ↵Serhiy Storchaka2019-05-311-1/+4
| | | | | | (GH-11859) Escape ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) in Unicode strings.
* bpo-339827: Do not swallow exceptions in the _ssl module. (GH-12756)Serhiy Storchaka2019-05-311-37/+52
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-3167-338/+337
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36999: Add asyncio.Task.get_coro() (GH-13680)Alex Grönholm2019-05-302-1/+31
| | | https://bugs.python.org/issue36999
* bpo-36974: remove _PyObject_HasFastCall (GH-13460)Jeroen Demeyer2019-05-301-2/+2
|
* bpo-36974: inherit the vectorcall protocol (GH-13498)Jeroen Demeyer2019-05-301-1/+67
|
* bpo-36935: Remove usage of the deprecated ↵Zackery Spytz2019-05-301-2/+6
| | | | | | | | PyErr_SetFromWindowsErrWithUnicodeFilename() (GH-13355) In e895de3e7f3cc2f7213b87621cfe9812ea4343f0, the deprecated function PyErr_SetFromWindowsErrWithUnicodeFilename() was added in two functions in Modules/_winapi.c. This function was deprecated in 3.3.
* bpo-37007: Implement socket.if_nametoindex(), if_indextoname() and ↵Zackery Spytz2019-05-291-11/+49
| | | | if_nameindex() on Windows (GH-13522)
* bpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)Zackery Spytz2019-05-291-0/+28
| | | https://bugs.python.org/issue26836
* bpo-32388: Remove cross-version binary compatibility requirement in tp_flags ↵Antoine Pitrou2019-05-2911-26/+19
| | | | | | | | (GH-4944) It is now allowed to add new fields at the end of the PyTypeObject struct without having to allocate a dedicated compatibility flag in tp_flags. This will reduce the risk of running out of bits in the 32-bit tp_flags value.
* bpo-26836: Add os.memfd_create() (#13567)Zackery Spytz2019-05-292-1/+124
| | | | | | | | | | | | | | | | | | | | * bpo-26836: Add os.memfd_create() * Use the glibc wrapper for memfd_create() Co-Authored-By: Christian Heimes <christian@python.org> * Fix deletions caused by autoreconf. * Use MFD_CLOEXEC as the default value for *flags*. * Add memset_s to configure.ac. * Revert memset_s changes. * Apply the requested changes. * Tweak the docs.
* bpo-22385: Support output separators in hex methods. (#13578)Gregory P. Smith2019-05-292-25/+123
| | | | | | | | | | | | | | | | | | * bpo-22385: Support output separators in hex methods. Also in binascii.hexlify aka b2a_hex. The underlying implementation behind all hex generation in CPython uses the same pystrhex.c implementation. This adds support to bytes, bytearray, and memoryview objects. The binascii module functions exist rather than being slated for deprecation because they return bytes rather than requiring an intermediate step through a str object. This change was inspired by MicroPython which supports sep in its binascii implementation (and does not yet support the .hex methods). https://bugs.python.org/issue22385
* bpo-36974: implement PEP 590 (GH-13185)Jeroen Demeyer2019-05-292-7/+30
| | | | | Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-33164: blake2 fix for HP-UX (GH-13633)David Carlier2019-05-291-0/+3
|
* bpo-37076: _thread.start_new_thread() calls _PyErr_WriteUnraisableMsg() ↵Victor Stinner2019-05-291-14/+4
| | | | | | | (GH-13617) _thread.start_new_thread() now logs uncaught exception raised by the function using sys.unraisablehook(), rather than sys.excepthook(), so the hook gets access to the function which raised the exception.
* bpo-37001: Makes symtable.symtable have parity with compile for input (#13483)Dino Viehland2019-05-282-23/+24
| | | | | | | * Makes symtable.symtable have parity for accepted datatypes for source code as compile() * Add NEWS blurb
* bpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)Jeroen Demeyer2019-05-282-1/+59
| | | Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-29883: Asyncio proactor udp (GH-13440)Andrew Svetlov2019-05-281-16/+356
| | | | | | Follow-up for #1067 https://bugs.python.org/issue29883
* bpo-1230540: Add threading.excepthook() (GH-13515)Victor Stinner2019-05-271-0/+156
| | | | | | | | | | | | | | | | | | | Add a new threading.excepthook() function which handles uncaught Thread.run() exception. It can be overridden to control how uncaught exceptions are handled. threading.ExceptHookArgs is not documented on purpose: it should not be used directly. * threading.excepthook() and threading.ExceptHookArgs. * Add _PyErr_Display(): similar to PyErr_Display(), but accept a 'file' parameter. * Add _thread._excepthook(): C implementation of the exception hook calling _PyErr_Display(). * Add _thread._ExceptHookArgs: structseq type. * Add threading._invoke_excepthook_wrapper() which handles the gory details to ensure that everything remains alive during Python shutdown. * Add unit tests.
* bpo-32941: Add madvise() for mmap objects (GH-6172)Zackery Spytz2019-05-271-0/+118
| | | | Allow mmap objects to access the madvise() system call.
* bpo-36763: Implement the PEP 587 (GH-13592)Victor Stinner2019-05-276-291/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a whole new documentation page: "Python Initialization Configuration" * PyWideStringList_Append() return type is now PyStatus, instead of int * PyInterpreterState_New() now calls PyConfig_Clear() if PyConfig_InitPythonConfig() fails. * Rename files: * Python/coreconfig.c => Python/initconfig.c * Include/cpython/coreconfig.h => Include/cpython/initconfig.h * Include/internal/: pycore_coreconfig.h => pycore_initconfig.h * Rename structures * _PyCoreConfig => PyConfig * _PyPreConfig => PyPreConfig * _PyInitError => PyStatus * _PyWstrList => PyWideStringList * Rename PyConfig fields: * use_module_search_paths => module_search_paths_set * module_search_path_env => pythonpath_env * Rename PyStatus field: _func => func * PyInterpreterState: rename core_config field to config * Rename macros and functions: * _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv() * _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv() * _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString() * _PyInitError_Failed() => PyStatus_Exception() * _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx * _Py_UnixMain() => Py_BytesMain() * _Py_ExitInitError() => Py_ExitStatusException() * _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs() * _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs() * _Py_PreInitialize() => Py_PreInitialize() * _Py_RunMain() => Py_RunMain() * _Py_InitializeFromConfig() => Py_InitializeFromConfig() * _Py_INIT_XXX() => _PyStatus_XXX() * _Py_INIT_FAILED() => _PyStatus_EXCEPTION() * Rename 'err' PyStatus variables to 'status' * Convert RUN_CODE() macro to config_run_code() static inline function * Remove functions: * _Py_InitializeFromArgs() * _Py_InitializeFromWideArgs() * _PyInterpreterState_GetCoreConfig()
* bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)Yury Selivanov2019-05-271-7/+4
| | | | | | | | | | | | | | | This will address the common mistake many asyncio users make: an "except Exception" clause breaking Tasks cancellation. In addition to this change, we stop inheriting asyncio.TimeoutError and asyncio.InvalidStateError from their concurrent.futures.* counterparts. There's no point for these exceptions to share the inheritance chain. In 3.9 we'll focus on implementing supervisors and cancel scopes, which should allow better handling of all exceptions, including SystemExit and KeyboardInterrupt
* bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)Victor Stinner2019-05-273-9/+19
| | | | | * sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
* bpo-36785: PEP 574 implementation (GH-7076)Antoine Pitrou2019-05-262-135/+604
|
* bpo-37021: Port _randommodule to the argument clinic (GH-13532)Pablo Galindo2019-05-242-26/+200
|
* bpo-36710: Add tstate parameter in ceval.c (GH-13547)Victor Stinner2019-05-241-2/+3
| | | | | | | | | | | | | | | | * Fix a possible reference leak in _PyErr_Print() if exception is NULL. * PyErr_BadInternalCall(): replace PyErr_Format() with _PyErr_SetString(). * Add pycore_pyerrors.h header file. * New functions: * _PyErr_Clear() * _PyErr_Fetch() * _PyErr_Print() * _PyErr_Restore() * _PyErr_SetObject() * _PyErr_SetString() * Add 'tstate' parameter to _PyEval_AddPendingCall().
* bpo-37031: Fix PyOS_AfterFork_Child() (GH-13537)Victor Stinner2019-05-241-1/+1
| | | | | | | PyOS_AfterFork_Child(): _PyInterpreterState_DeleteExceptMain() must be called after _PyRuntimeState_ReInitThreads(). _PyRuntimeState_ReInitThreads() resets interpreters mutex after fork, mutex used by _PyInterpreterState_DeleteExceptMain().
* bpo-37031: Reuse _PyRuntime.main_thread in signalmodule.c (GH-13538)Victor Stinner2019-05-241-16/+16
| | | | | | | | | | Remove main_thread and main_interp variables from signalmodule.c: reuse _PyRuntime which already track the main thread and the main interpreter. * Remove #include <sys/types.h> which became useless: getpid() call has been removed. * Add runtime argument to is_main() * is_main() now gets the interpreter from runtime.
* bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not ↵Matěj Cepl2019-05-231-4/+9
| | | | | handled (GH-7778) ``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-2311-3/+257
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-33164: update blake2 implementation (GH-6286)David Carlier2019-05-2322-675/+18361
|
* bpo-36084: Add native thread ID (TID) to threading.Thread (GH-13463)Jake Tesler2019-05-221-0/+20
| | | | Add native thread ID (TID) to threading.Thread objects (supported platforms: Windows, FreeBSD, Linux, macOS).
* bpo-31862: Port binascii to PEP 489 multiphase initialization (GH-4108)Marcel Plch2019-05-221-34/+103
|
* bpo-36829: Add sys.unraisablehook() (GH-13187)Victor Stinner2019-05-221-0/+15
| | | | | | | | | | | | | | | | | | | Add new sys.unraisablehook() function which can be overridden to control how "unraisable exceptions" are handled. It is called when an exception has occurred but there is no way for Python to handle it. For example, when a destructor raises an exception or during garbage collection (gc.collect()). Changes: * Add an internal UnraisableHookArgs type used to pass arguments to sys.unraisablehook. * Add _PyErr_WriteUnraisableDefaultHook(). * The default hook now ignores exception on writing the traceback. * test_sys now uses unittest.main() to automatically discover tests: remove test_main(). * Add _PyErr_Init(). * Fix PyErr_WriteUnraisable(): hold a strong reference to sys.stderr while using it
* bpo-36648: fix mmap issue for VxWorks (GH-12394)Lihua Zhao2019-05-211-0/+7
| | | | | The mmap module set MAP_SHARED flag when map anonymous memory, however VxWorks only support MAP_PRIVATE when map anonymous memory, this commit clear MAP_SHARED and set MAP_PRIVATE.
* bpo-31904: Add posix module support for VxWorks (GH-12118)pxinwr2019-05-212-12/+70
|
* Revert "bpo-36084: Add native thread ID to threading.Thread objects ↵Victor Stinner2019-05-211-16/+0
| | | | | (GH-11993)" (GH-13458) This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.
* bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421)Erik Janssens2019-05-211-2/+2
| | | | Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant. Moreover, include windows.h on Windows, not only when MSC is used.
* bpo-36888: Add multiprocessing.parent_process() (GH-13247)Thomas Moreau2019-05-201-0/+1
|
* bpo-35134: Split traceback.h header (GH-13430)Victor Stinner2019-05-192-0/+2
| | | | Add new Include/cpython/traceback.h and Include/internal/traceback.h header files.
* bpo-36957: Speed up math.isqrt (#13405)Mark Dickinson2019-05-191-8/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add math.isqrt function computing the integer square root. * Code cleanup: remove redundant comments, rename some variables. * Tighten up code a bit more; use Py_XDECREF to simplify error handling. * Update Modules/mathmodule.c Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Update Modules/mathmodule.c Use real argument clinic type instead of an alias Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Add proof sketch * Updates from review. * Correct and expand documentation. * Fix bad reference handling on error; make some variables block-local; other tidying. * Style and consistency fixes. * Add missing error check; don't try to DECREF a NULL a * Simplify some error returns. * Another two test cases: - clarify that floats are rejected even if they happen to be squares of small integers - TypeError beats ValueError for a negative float * Add fast path for small inputs. Needs tests. * Speed up isqrt for n >= 2**64 as well; add extra tests. * Reduce number of test-cases to avoid dominating the run-time of test_math. * Don't perform unnecessary extra iterations when computing c_bit_length. * Abstract common uint64_t code out into a separate function. * Cleanup. * Add a missing Py_DECREF in an error branch. More cleanup. * Update Modules/mathmodule.c Add missing `static` declaration to helper function. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Add missing backtick.
* bpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)Serhiy Storchaka2019-05-191-23/+7
|
* bpo-36887: add math.isqrt (GH-13244)Mark Dickinson2019-05-182-1/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add math.isqrt function computing the integer square root. * Code cleanup: remove redundant comments, rename some variables. * Tighten up code a bit more; use Py_XDECREF to simplify error handling. * Update Modules/mathmodule.c Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Update Modules/mathmodule.c Use real argument clinic type instead of an alias Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Add proof sketch * Updates from review. * Correct and expand documentation. * Fix bad reference handling on error; make some variables block-local; other tidying. * Style and consistency fixes. * Add missing error check; don't try to DECREF a NULL a * Simplify some error returns. * Another two test cases: - clarify that floats are rejected even if they happen to be squares of small integers - TypeError beats ValueError for a negative float * Documentation and markup improvements; thanks Serhiy for the suggestions! * Cleaner Misc/NEWS entry wording. * Clean up (with one fix) to the algorithm explanation and proof.
* 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.