summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)Miss Islington (bot)2021-06-171-1/+1
| | | | | | `ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`. (cherry picked from commit c544393b89f9b3e2b1a22588fc9ae58019314879) Co-authored-by: Joe <nigelchiang@outlook.com>
* bpo-42972: _thread.RLock implements the GH protocol (GH-26734)Miss Islington (bot)2021-06-151-1/+10
| | | | | | | The _thread.RLock type now fully implement the GC protocol: add a traverse function and the Py_TPFLAGS_HAVE_GC flag. (cherry picked from commit 1cd3d859a49b047dd08abb6f44f0539564d3525a) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.10] bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) (GH-26705)Miss Islington (bot)2021-06-131-1/+1
| | | | | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit bf527277d4e4907e32d76ca7ba667ab3149fe258) Co-authored-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran
* bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680)Miss Islington (bot)2021-06-131-1/+1
| | | | | (cherry picked from commit cb7230c7a7d6d497e54c25e9ba640eec79de10f2) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* [3.10] Add more const modifiers. (GH-26691). (GH-26692)Serhiy Storchaka2021-06-121-2/+2
| | | | | (cherry picked from commit be8b631b7a587aa781245e14c8cca32970e1be5b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)Miss Islington (bot)2021-06-111-14/+28
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit e26014f1c47d26d6097ff7a0f25384bfbde714a9) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-44363: Get test_capi passing with address sanitizer (GH-26639)Miss Islington (bot)2021-06-101-0/+5
| | | | | (cherry picked from commit 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b) Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-44227: Update bisect docstrings (GH-26548) (GH-26563)Miss Islington (bot)2021-06-062-11/+11
|
* bpo-44304: Ensure the sqlite3 destructor callback is always called with the ↵Miss Islington (bot)2021-06-052-0/+7
| | | | | | | GIL held (GH-26551) (GH_26552) (cherry picked from commit 6e3b7cf3af3ed7758b2c2193c1d393feb8ab8f72) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement ↵Miss Islington (bot)2021-06-051-7/+4
| | | | | | | objects (GH-26545) (cherry picked from commit fa106a685c1f199aca5be5c2d0277a14cc9057bd) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-43853: Handle sqlite3_value_text() errors (GH-25422)Miss Islington (bot)2021-06-041-8/+11
| | | | | (cherry picked from commit 006fd869e4798b68e266f5de89c83ddb531a756b) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* [3.10] bpo-42972: Track sqlite3 statement objects (GH-26475) (GH-26515)Erlend Egeberg Aasland2021-06-034-48/+40
| | | | | | | | | | | | | | Allocate and track statement objects in pysqlite_statement_create. By allocating and tracking creation of statement object in pysqlite_statement_create(), the caller does not need to worry about GC syncronization, and eliminates the possibility of getting a badly created object. All related fault handling is moved to pysqlite_statement_create(). Co-authored-by: Victor Stinner <vstinner@python.org>. (cherry picked from commit fffa0f92adaaed0bcb3907d982506f78925e9052) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-44285: getpath.c: Assert that env_file is NULL during an error check ↵Miss Islington (bot)2021-06-021-0/+1
| | | | | | | | (GH-26486) This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well. (cherry picked from commit bdb56902a3bfe12b10f85a941d5dd0eae739f1a8) Co-authored-by: stratakis <cstratak@redhat.com>
* bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464) (GH-26465)Miss Islington (bot)2021-05-312-2/+9
| | | | | | | | | | | * _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5445c019542246d93fe2f9e195d3131686) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-42972: Fully implement GC protocol for xxlimited (GH-26451) (GH-26460)Miss Islington (bot)2021-05-312-0/+16
| | | | | | | (cherry picked from commit 4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766) Co-authored-by: Hai Shi <shihai1992@gmail.com> Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452) (GH-26461)Miss Islington (bot)2021-05-316-41/+44
| | | | | (cherry picked from commit d1124b09e8251061dc040cbd396f35ae57783f4a) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-44252: Correctly implement gc support for SSLError objects (GH-26439) ↵Miss Islington (bot)2021-05-281-2/+1
| | | | | | | (GH-26441) (cherry picked from commit 8b4312b909abff3100c1f18fb3efa5c25617fee3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.10] bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) (#26430)Ken Jin2021-05-281-2/+46
| | | | | * bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) * untrack earlier
* bpo-42972: Fully implement GC protocol for functools LRU cache (GH-26423)Miss Islington (bot)2021-05-281-2/+4
| | | | | (cherry picked from commit 3f8d33252722750e6c019d3df7ce0fabf7bdd45e) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully implement GC protocol for functools keywrapper and partial ↵Miss Islington (bot)2021-05-281-22/+37
| | | | | | | types (GH-26363) (GH-26424) (cherry picked from commit 8994e9c2cd775ddf7b0723824da53fe0d7c039ac) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-44256: Do not expose _functools._list_elem_type (GH-26416)Miss Islington (bot)2021-05-281-3/+2
| | | | | | It is internal use only type. (cherry picked from commit 28be3191a9db2769ed05e55c6bcbccdd029656dd) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-42972: Fully implement GC protocol for re types (GH-26368) (GH-26414)Miss Islington (bot)2021-05-281-19/+81
| | | | | (cherry picked from commit fba42d11880f444bb94d9891e3949f082a57b9a9) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully support GC protocol for _operator heap types (GH-26371) ↵Miss Islington (bot)2021-05-271-5/+33
| | | | | | | (GH-26413) (cherry picked from commit f4b70c22c8e37dd7a06702e30b121a6651683421) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully support GC for mmap heap types (GH-26373)Miss Islington (bot)2021-05-271-3/+10
| | | | | (cherry picked from commit 318adeba780851c416505e48a3454cacca831419) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully support GC protocol for _queue.SimpleQueue (GH-26372) ↵Miss Islington (bot)2021-05-271-1/+10
| | | | | | | (GH-26406) (cherry picked from commit 4d7f8f9f7fb09ea8eb4e43409a16a91b0bf18571) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully implement GC protocol for ssl heap types (GH-26370) (GH-26399)Miss Islington (bot)2021-05-271-28/+45
| | | | | (cherry picked from commit dcb8786a9848516e823e090bb36079678913d8d3) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap ↵Miss Islington (bot)2021-05-275-35/+69
| | | | | | | | | | types (GH-26376) * bpo-42972: pyexpat * bpo-42972: unicodedata * bpo-42972: dbm/gdbm (cherry picked from commit 59af59c2dfa52dcd5605185263f266a49ced934c) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* [3.10] bpo-42972: Fully support GC for hashlib heap types (GH-26374) (GH-26398)Miss Islington (bot)2021-05-274-16/+69
| | | | | | | | (cherry picked from commit 6ef5ba391d700bde7ec3ffd5fb7132a30dd309c4) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Automerge-Triggered-By: GH:tiran
* bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) ↵Miss Islington (bot)2021-05-261-8/+12
| | | | | | | | | | | | | | (GH-26393) Move _PyLong_GetZero() and _PyLong_GetOne() loop invariants outside loops in functions: * math.comb() * math.gcd() * math.lcm() * math.perm() (cherry picked from commit 3e7ee02327db13e4337374597cdc4458ecb9e3ad) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-42972: Fully implement GC protocol for arraymodule types (GH-26114)Miss Islington (bot)2021-05-251-2/+11
| | | | | (cherry picked from commit bd404ccac0d3e8358995ac0cbeec9373bb6c4d96) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-42972: Fully implement GC protocol for sqlite3 heap types (GH-26104)Miss Islington (bot)2021-05-256-72/+190
| | | | | (cherry picked from commit d3c277a59c3d93fb92f7026f63678083d1d49fc5) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* Fix compiler warning for misleading guarding in the tkinter (GH-26244) ↵Miss Islington (bot)2021-05-191-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-26251) The newest gcc emmits this warning: ``` /Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 272 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; } | ^~ /Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’ 2869 | LEAVE_PYTHON | ^~~~~~~~~~~~ /Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 243 | (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*))) | ^ /Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’ 272 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; } | ^~~~~~~~~~ /Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’ 2869 | LEAVE_PYTHON ``` that's because the macro packs together two statements at the same level as the "if". The warning is misleading but is very noisy so it makes sense to fix it. (cherry picked from commit 95d04710c5fb0df5393b5add2c5c2de2412673eb) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Fix compiler warning in the xml module (GH-26245) (GH-26249)Miss Islington (bot)2021-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newest version of gcc complains about passing un-initialized arrays as constant pointers: ``` /Modules/expat/xmltok_ns.c: In function ‘findEncodingNS’: /Modules/expat/xmltok.h:272:10: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized] 272 | (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’ 95 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); | ^~~~~~~~~~~~~~ /Modules/expat/xmltok.h:272:10: note: by argument 5 of type ‘const char *’ to ‘enum XML_Convert_Result(const ENCODING *, const char **, const char *, char **, const char *)’ {aka ‘enum XML_Convert_Result(const struct encoding *, const char **, const char *, char **, const char *)’} 272 | (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’ 95 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); | ^~~~~~~~~~~~~~ In file included from /Modules/expat/xmltok.c:1657: /Modules/expat/xmltok_ns.c:92:8: note: ‘buf’ declared here 92 | char buf[ENCODING_MAX]; ``` (cherry picked from commit be93f81e58ba3742589259ef84325a95b547e424) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-44145: Release the GIL around HMAC_Update. (GH-26157)Miss Islington (bot)2021-05-171-2/+4
| | | | | | | | | It was always meant to be released for parallelization. This now matches the other similar code in the module. Thanks michaelforney for noticing! (cherry picked from commit c10392e7ddb3eafbd11e9ffe335c07648426715f) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-44116: Add GC support to _csv heap types (GH-26074) (GH-26081)Miss Islington (bot)2021-05-121-30/+32
| | | (cherry picked from commit e5ba1fe995d4b4f3f6a089a7ec4dd186dd573830)
* bpo-40645: Fix ref leaks in _hashopenssl (GH-26079)Miss Islington (bot)2021-05-121-4/+9
| | | | | (cherry picked from commit 504ffdae4e0cb7775f3e584c3b1d20c262fdfd7e) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-44089: Allow subclassing of ``csv.Error`` (GH-26008) (GH-26066)Miss Islington (bot)2021-05-121-1/+1
| | | | | | | | | | * fix subclass error * Update 2021-05-09-22-52-34.bpo-44089.IoANsN.rst (cherry picked from commit 2b458c1dba4058c808fde25226bb2d91c5a909ca) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-40943: Fix skipitem() didn't raise SystemError (GH-25937)Miss Islington (bot)2021-05-071-3/+20
| | | | | | | `convertitem()` raises `SystemError` when 'GH-' is used without `PY_SSIZE_T_CLEAN`. This commit makes `skipitem()` raise it too. (cherry picked from commit 4ebf4a6bfad4afcbab3baf9c0159c7767e2a64c0) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927)Miss Islington (bot)2021-05-051-0/+5
| | | | | | | | Contributed-By: Matthias Klose Automerge-Triggered-By: GH:tiran (cherry picked from commit da5c808fb50d34bc2e180d9481706072f33025da) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* Eliminate duplicated assignment in _randommodule.c (GH-25904) (GH-25909)Miss Islington (bot)2021-05-051-1/+1
|
* Add C-API tests (GH-25886) (#25887)Miss Islington (bot)2021-05-041-0/+21
| | | | | (cherry picked from commit 2f5baa17504feb9a7613bac32fdceed4894434de) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-38530: Refactor and improve AttributeError suggestions (GH-25776)Dennis Sweeney2021-05-031-0/+87
| | | | | | | | | | | | | | | | | | | | - Make case-swaps half the cost of any other edit - Refactor Levenshtein code to not use memory allocator, and to bail early on no match. - Add comments to Levenshtein distance code - Add test cases for Levenshtein distance behind a debug macro - Set threshold to `(name_size + item_size + 3) * MOVE_COST / 6`. - Reasoning: similar to `difflib.SequenceMatcher.ratio()` >= 2/3: ``` "Multiset Jaccard similarity" >= 2/3 matching letters / total letters >= 2/3 (name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3 1 - (2*distance) / (name_size + item_size) >= 2/3 1/3 >= (2*distance) / (name_size + item_size) (name_size + item_size) / 6 >= distance With rounding: (name_size + item_size + 3) // 6 >= distance ``` Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-43916: Move the _PyStructSequence_InitType function to the internal API ↵Pablo Galindo2021-05-031-1/+1
| | | | (GH-25854)
* bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583)Batuhan Taskaya2021-05-031-1/+0
|
* bpo-43977: Make sure that tp_flags for pattern matching are inherited ↵Mark Shannon2021-05-021-2/+9
| | | | correctly. (GH-25813)
* bpo-43434: Clean up sqlite3.connect() after GH-25818 (GH-25823)Erlend Egeberg Aasland2021-05-021-8/+1
|
* bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ ↵Erlend Egeberg Aasland2021-05-022-9/+8
| | | | (GH-25818)
* bpo-32745: Fix a regression in the handling of ctypes' c_wchar_p type (#8721)Zackery Spytz2021-05-021-1/+2
| | | | | | Embedded nulls would cause a ValueError to be raised. Thanks go to Eryk Sun for their analysis. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792)Christian Heimes2021-05-0210-18/+18
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)Christian Heimes2021-05-011-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ssl module now has more secure default settings. Ciphers without forward secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits weak RSA, DH, and ECC keys with less than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2. Settings are based on Hynek Schlawack's research. ``` $ openssl version OpenSSL 1.1.1k FIPS 25 Mar 2021 $ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM' TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any Au=any Enc=CHACHA20/POLY1305(256) Mac=AEAD TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD TLS_AES_128_CCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESCCM(128) Mac=AEAD ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(128) Mac=AEAD ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384 ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384 ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(128) Mac=SHA256 ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA256 DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(128) Mac=AEAD DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256 DHE-RSA-AES128-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(128) Mac=SHA256 ``` Signed-off-by: Christian Heimes <christian@python.org>