summaryrefslogtreecommitdiff
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)Serhiy Storchaka2019-09-161-5/+7
|
* Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)Hai Shi2019-09-161-1/+2
|
* bpo-37798: Prevent undefined behavior in direct calls to the C helper ā†µRaymond Hettinger2019-09-151-1/+17
| | | | function. (#16149)
* Fix missing dec ref (#16158)Dino Viehland2019-09-151-0/+1
|
* bpo-38153: detect shake independently from sha3 (GH-16143)Christian Heimes2019-09-141-2/+11
| | | | | XOF digests (SHAKE) are not available in OpenSSL 1.1.0 but SHA3 fixed-length digests are. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-38116: Convert select module to PEP-384 (#15971)Dino Viehland2019-09-142-245/+210
| | | | | | | | | | * Convert select module to PEP-384 Summary: Do the necessary versions to be Pyro-compatible, including migrating `PyType_Ready` to `PyType_FromSpec` and moving static data into a new `_selectstate` struct. * šŸ“œšŸ¤– Added by blurb_it. * Fixup Mac OS/X build
* bpo-37206: Unrepresentable default values no longer represented as None. ā†µSerhiy Storchaka2019-09-1426-202/+200
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. ā†µSerhiy Storchaka2019-09-131-85/+65
| | | | | | | | | | | | | (GH-15652) * Fix a crash in comparing with float (and maybe other crashes). * They are now never equal to strings and non-integer numbers. * Comparison with a large number no longer raises OverflowError. * Arbitrary exceptions no longer silenced in constructors and comparisons. * TypeError raised in the constructor contains now the name of the type. * Accept only ChannelID and int-like objects in channel functions. * Accept only InterpreterId, int-like objects and str in the InterpreterId constructor. * Accept int-like objects, not just int in interpreter related functions.
* bpo-38150 Fix refleak in the finalizer of a _testcapimodule type (GH-16115)Eddie Elizondo2019-09-131-5/+13
| | | | | | | | | | The PyLong created in the finalizer was not being cleaned up https://bugs.python.org/issue38150 Automerge-Triggered-By: @matrixise
* bpo-38153: Normalize hashlib algorithm names (GH-16083)Christian Heimes2019-09-131-21/+146
| | | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-38075: Port _randommodule.c to PEP-384 (GH-15798)Dino Viehland2019-09-131-57/+92
| | | | | | | | | | - Migrate `Random_Type` to `PyType_FromSpec` - To simulate an old use of `PyLong_Type.tp_as_number->nb_absolute`, I added code to the module init function to stash `int.__abs__` for later use. Ideally we'd use `PyType_GetSlot()` instead, but it doesn't currently work for static types in CPython, and implementing it just for this case doesn't seem worth it. - Do exact check for long and dispatch to PyNumber_Absolute, use vector call when not exact.
* bpo-9216: Add usedforsecurity to hashlib constructors (GH-16044)Christian Heimes2019-09-1216-159/+466
| | | | | The usedforsecurity keyword only argument added to the hash constructors is useful for FIPS builds and similar restrictive environment with non-technical requirements that legacy algorithms be forbidden by their implementations without being explicitly annotated as not being used for any security related purposes. Linux distros with FIPS support benefit from this being standard rather than making up their own way(s) to do it. Contributed and Signed-off-by: Christian Heimes christian@python.org
* bpo-36046: Add user and group parameters to subprocess (GH-11950)Patrick McLean2019-09-121-4/+132
| | | | | | | | | | | | | | * subprocess: Add user, group and extra_groups paremeters to subprocess.Popen This adds a `user` parameter to the Popen constructor that will call setreuid() in the child before calling exec(). This allows processes running as root to safely drop privileges before running the subprocess without having to use a preexec_fn. This also adds a `group` parameter that will call setregid() in the child process before calling exec(). Finally an `extra_groups` parameter was added that will call setgroups() to set the supplimental groups.
* bpo-38137: Re-add OpenSSL 1.0.2 compat (GH-16051)Christian Heimes2019-09-121-0/+6
| | | | | | | | | | The defines are required for OpenSSL 1.0.2 and LibreSSL. https://bugs.python.org/issue38134 Automerge-Triggered-By: @tiran
* bpo-21872: fix lzma library decompresses data incompletely (GH-14048)animalize2019-09-121-6/+22
| | | | | | | * 1. add test case with wrong behavior * 2. fix bug when max_length == -1 * 3. allow b"" as valid input data for decompress_buf() * 4. when max_length >= 0, let needs_input mechanism works * add more asserts to test case
* bpo-38132: Check EVP_DigestUpdate for error (GH-16041)Christian Heimes2019-09-121-6/+16
|
* bpo-38132: Simplify _hashopenssl code (GH-16023)Christian Heimes2019-09-122-122/+385
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-38134: Remove PKBDF2_HMAC_fast from _hashopenssl (GH-16028)Christian Heimes2019-09-122-123/+1
| | | Signed-off-by: Christian Heimes <christian@python.org>
* closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for ā†µZackery Spytz2019-09-121-1/+5
| | | | | failure. (GH-16011) An exception may occur during a PyObject_IsSubclass() call.
* closes bpo-37405: Make socket.getsockname() always return a tuple for ā†µbggardner2019-09-121-1/+1
| | | | | AF_CAN. (GH-14392) This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
* bpo-37879: Fix warnings in _testcapimodule (GH-16004)Petr Viktorin2019-09-121-6/+7
|
* bpo-32592: Set Windows 8 as the minimum required version for API support ā†µSteve Dower2019-09-111-2/+0
| | | | (GH-15951)
* bpo-33166: Change os.cpu_count to return active (real) processors (GH-15949)Steve Dower2019-09-111-17/+3
|
* bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)Jakub KulĆ­k2019-09-111-0/+25
| | | Use fdwalk() on platforms that support it to implement os.closerange().
* bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type ā†µEddie Elizondo2019-09-111-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-15323) The instance destructor for a type is responsible for preparing an instance for deallocation by decrementing the reference counts of its referents. If an instance belongs to a heap type, the type object of an instance has its reference count decremented while for static types, which are permanently allocated, the type object is unaffected by the instance destructor. Previously, the default instance destructor searched the class hierarchy for an inherited instance destructor and, if present, would invoke it. Then, if the instance type is a heap type, it would decrement the reference count of that heap type. However, this could result in the premature destruction of a type because the inherited instance destructor should have already decremented the reference count of the type object. This change avoids the premature destruction of the type object by suppressing the decrement of its reference count when an inherited, non-default instance destructor has been invoked. Finally, an assertion on the Py_SIZE of a type was deleted. Heap types have a non zero size, making this into an incorrect assertion. https://github.com/python/cpython/pull/15323
* bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)Jordon Xu2019-09-103-6/+6
|
* bpo-38073: Make pwd module PEP-384 compatible (GH-15790)Dino Viehland2019-09-101-16/+35
| | | | | | | | | | Makes the pwd module PEP-384 compatible https://bugs.python.org/issue38073 Automerge-Triggered-By: @tiran
* bpo-37499: Test various C calling conventions (GH-15776)Petr Viktorin2019-09-101-0/+164
| | | | | | | | | | Add functions with various calling conventions to `_testcapi`, expose them as module-level functions, bound methods, class methods, and static methods, and test calling them and introspecting them through GDB. https://bugs.python.org/issue37499 Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Automerge-Triggered-By: @pganssle
* bpo-38069: Convert _posixsubprocess to PEP-384 (GH-15780)Dino Viehland2019-09-101-8/+58
| | | | | | | | | | Summary: Eliminate uses of `_Py_IDENTIFIER` from `_posixsubprocess`, replacing them with interned strings. Also tries to find an existing version of the module, which will allow subinterpreters. https://bugs.python.org/issue38069
* bpo-38071: Make termios PEP-384 compatible (GH-15785)Dino Viehland2019-09-101-20/+47
| | | | Make the termios module PEP-384 compatible.
* bpo-38072: PEP-384 grpmodule (GH-15788)Dino Viehland2019-09-101-19/+40
| | | | Make the grp module PEP-384 compliant.
* Fix calling order of PyEval_InitThreads. (GH-4602)Kenta Murata2019-09-101-1/+1
| | | | As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called before Py_Initialize() function.
* bpo-38074: Make zlib extension module PEP-384 compatible (GH-15792)Dino Viehland2019-09-101-73/+86
| | | | Updated zlibmodule.c to be PEP 384 compliant.
* bpo-38076: Make struct module PEP-384 compatible (#15805)Dino Viehland2019-09-101-147/+172
| | | | | | | | | | * PEP-384 _struct * More PEP-384 fixes for _struct Summary: Add a couple of more fixes for `_struct` that were previously missed such as removing `tp_*` accessors and using `PyBytesWriter` instead of calling `PyBytes_FromStringAndSize` with `NULL`. Also added a test to confirm that `iter_unpack` type is still uninstantiable. * šŸ“œšŸ¤– Added by blurb_it.
* bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250)Sergey Fedoseev2019-09-091-0/+13
|
* bpo-35941: Fix performance regression in new code (GH-12610)Christian Heimes2019-09-091-28/+27
| | | | | | | | Accumulate certificates in a set instead of doing a costly list contain operation. A Windows cert store can easily contain over hundred certificates. The old code would result in way over 5,000 comparison operations Signed-off-by: Christian Heimes <christian@python.org>
* bpo-37649: Fix exec_prefix check (GH-14897)Orivej Desh2019-09-091-1/+1
|
* bpo-36279: Ensure os.wait3() rusage is initialized (GH-15111)Zackery Spytz2019-09-091-0/+6
| | | Co-Authored-By: David Wilson <dw@botanicus.net>
* bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782)Victor Stinner2019-09-091-0/+2
| | | | | | In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure that the object is not freed. If it's freed, the program fails with an assertion error and Python dumps informations about the freed object.
* bpo-38037: Fix reference counters in signal module (GH-15753)animalize2019-09-091-8/+17
|
* bpo-37702: Fix SSL's certificate-store leak on Windows (GH-15632)neonene2019-09-091-0/+1
| | | | | ssl_collect_certificates function in _ssl.c has a memory leak. Calling CertOpenStore() and CertAddStoreToCollection(), a store's refcnt gets incremented by 2. But CertCloseStore() is called only once and the refcnt leaves 1.
* bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls ā†µZackery Spytz2019-09-092-2/+5
| | | | | (GH-14462) If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition.
* bpo-38043: Use `bool` for boolean flags on is_normalized_quickcheck. (GH-15711)Greg Price2019-09-091-11/+11
|
* bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)Serhiy Storchaka2019-09-091-0/+9
| | | | RuntimeError is now raised in this case.
* Revert "Raise a RuntimeError when tee iterator is consumed from different ā†µSerhiy Storchaka2019-09-091-8/+0
| | | | | threads (GH-15567)" (GH-15736) This reverts commit fa220ec7633e9674baccc28dde987f29d7f65141.
* bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)HongWeipeng2019-09-081-1/+2
| | | | This is a complement to PR 13375.
* Remove some unused defines in multiprocessing.h. (GH-15661)Sergey Fedoseev2019-09-071-10/+0
| | | | | It looks like they are unused since 87cf220972c9cb400ddcd577962883dcc5dca51a.
* bpo-37878: Remove PyThreadState_DeleteCurrent() function (GH-15315)Joannah Nanjekye2019-09-052-4/+9
| | | | | | | * Rename PyThreadState_DeleteCurrent() to _PyThreadState_DeleteCurrent() * Move it to the internal C API Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
* bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)Steve Dower2019-09-041-6/+13
|
* closes bpo-37966: Fully implement the UAX #15 quick-check algorithm. (GH-15558)Greg Price2019-09-031-24/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of the `unicodedata.is_normalized` function is to answer the question `str == unicodedata.normalized(form, str)` more efficiently than writing just that, by using the "quick check" optimization described in the Unicode standard in UAX #15. However, it turns out the code doesn't implement the full algorithm from the standard, and as a result we often miss the optimization and end up having to compute the whole normalized string after all. Implement the standard's algorithm. This greatly speeds up `unicodedata.is_normalized` in many cases where our partial variant of quick-check had been returning MAYBE and the standard algorithm returns NO. At a quick test on my desktop, the existing code takes about 4.4 ms/MB (so 4.4 ns per byte) when the partial quick-check returns MAYBE and it has to do the slow normalize-and-compare: $ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \ -- 'unicodedata.is_normalized("NFD", s)' 50 loops, best of 5: 4.39 msec per loop With this patch, it gets the answer instantly (58 ns) on the same 1 MB string: $ build.dev/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \ -- 'unicodedata.is_normalized("NFD", s)' 5000000 loops, best of 5: 58.2 nsec per loop This restores a small optimization that the original version of this code had for the `unicodedata.normalize` use case. With this, that case is actually faster than in master! $ build.base/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \ -- 'unicodedata.normalize("NFD", s)' 500 loops, best of 5: 561 usec per loop $ build.dev/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \ -- 'unicodedata.normalize("NFD", s)' 500 loops, best of 5: 512 usec per loop