| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
`ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`.
(cherry picked from commit c544393b89f9b3e2b1a22588fc9ae58019314879)
Co-authored-by: Joe <nigelchiang@outlook.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
(cherry picked from commit cb7230c7a7d6d497e54c25e9ba640eec79de10f2)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
| |
(cherry picked from commit be8b631b7a587aa781245e14c8cca32970e1be5b)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e26014f1c47d26d6097ff7a0f25384bfbde714a9)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
| |
(cherry picked from commit 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b)
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
| |
|
|
|
|
|
|
|
| |
GIL held (GH-26551) (GH_26552)
(cherry picked from commit 6e3b7cf3af3ed7758b2c2193c1d393feb8ab8f72)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
| |
objects (GH-26545)
(cherry picked from commit fa106a685c1f199aca5be5c2d0277a14cc9057bd)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 006fd869e4798b68e266f5de89c83ddb531a756b)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
|
|
|
| |
* _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>
|
|
|
|
|
|
|
| |
(cherry picked from commit 4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766)
Co-authored-by: Hai Shi <shihai1992@gmail.com>
Co-authored-by: Hai Shi <shihai1992@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit d1124b09e8251061dc040cbd396f35ae57783f4a)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
| |
(GH-26441)
(cherry picked from commit 8b4312b909abff3100c1f18fb3efa5c25617fee3)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
| |
* bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381)
* untrack earlier
|
|
|
|
|
| |
(cherry picked from commit 3f8d33252722750e6c019d3df7ce0fabf7bdd45e)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
| |
types (GH-26363) (GH-26424)
(cherry picked from commit 8994e9c2cd775ddf7b0723824da53fe0d7c039ac)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
| |
It is internal use only type.
(cherry picked from commit 28be3191a9db2769ed05e55c6bcbccdd029656dd)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit fba42d11880f444bb94d9891e3949f082a57b9a9)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
| |
(GH-26413)
(cherry picked from commit f4b70c22c8e37dd7a06702e30b121a6651683421)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
| |
(cherry picked from commit 318adeba780851c416505e48a3454cacca831419)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
| |
(GH-26406)
(cherry picked from commit 4d7f8f9f7fb09ea8eb4e43409a16a91b0bf18571)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
| |
(cherry picked from commit dcb8786a9848516e823e090bb36079678913d8d3)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(cherry picked from commit 6ef5ba391d700bde7ec3ffd5fb7132a30dd309c4)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Automerge-Triggered-By: GH:tiran
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
| |
(cherry picked from commit bd404ccac0d3e8358995ac0cbeec9373bb6c4d96)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
| |
(cherry picked from commit d3c277a59c3d93fb92f7026f63678083d1d49fc5)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
| |
(cherry picked from commit e5ba1fe995d4b4f3f6a089a7ec4dd186dd573830)
|
|
|
|
|
| |
(cherry picked from commit 504ffdae4e0cb7775f3e584c3b1d20c262fdfd7e)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
| |
`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>
|
|
|
|
|
|
|
|
| |
Contributed-By: Matthias Klose
Automerge-Triggered-By: GH:tiran
(cherry picked from commit da5c808fb50d34bc2e180d9481706072f33025da)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
|
|
| |
(cherry picked from commit 2f5baa17504feb9a7613bac32fdceed4894434de)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
| |
(GH-25854)
|
| |
|
|
|
|
| |
correctly. (GH-25813)
|
| |
|
|
|
|
| |
(GH-25818)
|
|
|
|
|
|
| |
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>
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|