summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [3.8] bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13911)Miss Islington (bot)2019-06-081-1/+1
|
* bpo-37169: Rewrite _PyObject_IsFreed() unit tests (GH-13888) (GH-13895)Victor Stinner2019-06-071-13/+14
| | | | | | | Replace two Python function calls with a single one to ensure that no memory allocation is done between the invalid object is created and when _PyObject_IsFreed() is called. (cherry picked from commit 3bf0f3ad2046ac674d8e8a2c074a5a8b3327797d)
* [3.8] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() ↵Zackery Spytz2019-06-071-0/+22
| | | | | | | (GH-13860) (GH-13891) (cherry picked from commit dc2476500d91082f0c907772c83a044bf49af279) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-37165: Convert _count_elements to the argument clinic (GH-13848)Miss Islington (bot)2019-06-052-12/+48
| | | | | (cherry picked from commit e985804207473796a1326585b3e1b9e18c764345) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-35431: Drop the k <= n requirement (GH-13798)Raymond Hettinger2019-06-042-24/+31
|
* Revert "bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)" (GH-13795)Victor Stinner2019-06-041-1/+1
| | | This reverts commit 396e0a8d9dc65453cb9d53500d0a620602656cfe.
* bpo-37120: Add SSLContext.num_tickets (GH-13719)Christian Heimes2019-06-031-0/+37
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-34271: Fix compatibility with 1.0.2 (GH-13728)Christian Heimes2019-06-031-1/+10
| | | | | | Fix various compatibility issues with LibreSSL and OpenSSL 1.0.2 introduced by bpo-34271. Signed-off-by: Christian Heimes <christian@python.org>
* Revert "bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-06-032-11/+2
| | | | | _Py_AddPendingCall(). (gh-13714)" (GH-13780) This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
* bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings ↵Petr Viktorin2019-06-021-1/+1
| | | | (GH-13758)
* bpo-36974: Make tp_call=PyVectorcall_Call work for inherited types (GH-13699)Petr Viktorin2019-06-021-1/+1
| | | | | | | | | | | | | | | | | | When inheriting a heap subclass from a vectorcall class that sets `.tp_call=PyVectorcall_Call` (as recommended in PEP 590), the subclass does not inherit `_Py_TPFLAGS_HAVE_VECTORCALL`, and thus `PyVectorcall_Call` does not work for it. This attempts to solve the issue by: * always inheriting `tp_vectorcall_offset` unless `tp_call` is overridden in the subclass * inheriting _Py_TPFLAGS_HAVE_VECTORCALL for static types, unless `tp_call` is overridden * making `PyVectorcall_Call` ignore `_Py_TPFLAGS_HAVE_VECTORCALL` This means it'll be ever more important to only call `PyVectorcall_Call` on classes that support vectorcall. In `PyVectorcall_Call`'s intended role as `tp_call` filler, that's not a problem.
* bpo-37128: Add math.perm(). (GH-13731)Serhiy Storchaka2019-06-022-2/+165
|
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-06-012-2/+11
| | | | (gh-13714)
* Fix the error handling in bytesio_sizeof(). (GH-10459)Zackery Spytz2019-06-011-2/+7
| | | bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
* bpo-34303: Micro-optimizations in functools.reduce() (GH-8598)Sergey Fedoseev2019-06-011-3/+6
|
* bpo-35431: Refactor math.comb() implementation. (GH-13725)Serhiy Storchaka2019-06-012-92/+87
| | | | | | | * Fixed some bugs. * Added support for index-likes objects. * Improved error messages. * Cleaned up and optimized the code. * Added more tests.
* 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.