summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.10.11v3.10.11Pablo Galindo2023-04-041-2/+2
|
* Post 3.10.10Pablo Galindo2023-02-081-1/+1
|
* Python 3.10.10v3.10.10Pablo Galindo2023-02-071-2/+2
|
* Post 3.10.9Pablo Galindo2022-12-061-1/+1
|
* Python 3.10.9v3.10.9Pablo Galindo2022-12-061-2/+2
|
* Post 3.10.8Pablo Galindo2022-10-111-1/+1
|
* Python 3.10.8v3.10.8Pablo Galindo2022-10-111-2/+2
|
* gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)Miss Islington (bot)2022-09-251-2/+2
| | | | | (cherry picked from commit db39050396a104c73d0da473a2f00a62f9dfdfaa) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Post 3.10.7Pablo Galindo2022-09-061-1/+1
|
* Python 3.10.7v3.10.7Pablo Galindo2022-09-051-2/+2
|
* [3.10] gh-95778: Correctly pre-check for int-to-str conversion (GH-96537) ↵Gregory P. Smith2022-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#96563) Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =) The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact. The justification for the current check. The C code check is: ```c max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10 ``` In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is: $$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$ From this it follows that $$\frac{M}{3L} < \frac{s-1}{10}$$ hence that $$\frac{L(s-1)}{M} > \frac{10}{3} > \log_2(10).$$ So $$2^{L(s-1)} > 10^M.$$ But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check. <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org> (cherry picked from commit b126196838bbaf5f4d35120e0e6bcde435b0b480) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501)Gregory P. Smith2022-09-023-0/+39
| | | | | | | | | | | | | | | | | Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds. This PR comes fresh from a pile of work done in our private PSRT security response team repo. This backports https://github.com/python/cpython/pull/96499 aka 511ca9452033ef95bc7d7fc404b8161068226002 Signed-off-by: Christian Heimes [Red Hat] <christian@python.org> Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org> Reviews via the private PSRT repo via many others (see the NEWS entry in the PR). <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#).
* Fix typo in internal/pycore_atomic.h (GH-95939)Miss Islington (bot)2022-08-131-1/+1
| | | | | (cherry picked from commit 8281cbddc6f0fbc94f0c21cacfac79a2d4057a4b) Co-authored-by: fluesvamp <105884371+fluesvamp@users.noreply.github.com>
* Post 3.10.6Pablo Galindo2022-08-021-1/+1
|
* Python 3.10.6v3.10.6Pablo Galindo2022-08-011-2/+2
|
* [3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() ↵Miss Islington (bot)2022-06-161-0/+3
| | | | | | | | | | | | (GH-93742) (GH-93792) It combines PyImport_ImportModule() and PyObject_GetAttrString() and saves 4-6 lines of code on every use. Add also _PyImport_GetModuleAttr() which takes Python strings as arguments. (cherry picked from commit 6fd4c8ec7740523bb81191c013118d9d6959bc9d) (cherry picked from commit d42b3689f4a14694f5b1ff75c155141102aa2557) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Post 3.10.5Pablo Galindo2022-06-061-1/+1
|
* Python 3.10.5v3.10.5Pablo Galindo2022-06-061-2/+2
|
* gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066) ↵Miss Islington (bot)2022-05-241-1/+13
| | | | | | | | | | | | (GH-93146) Also while there, clarify a few things about why we reduce the hash to 32 bits. Co-authored-by: Eli Libman <eli@hyro.ai> Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit c1f5c903a7e4ed27190488f4e33b00d3c3d952e5)
* Post 3.10.4Pablo Galindo2022-03-241-1/+1
|
* Python 3.10.4v3.10.4Pablo Galindo2022-03-231-2/+2
|
* Post 3.10.3Pablo Galindo2022-03-161-1/+1
|
* Python 3.10.3v3.10.3Pablo Galindo2022-03-161-2/+2
|
* [3.10] bpo-46521: Fix codeop to use a new partial-input mode of the parser ↵Pablo Galindo Salgado2022-02-082-1/+5
| | | | | | | (GH-31010). (GH-31213) (cherry picked from commit 69e10976b2e7682c6d57f4272932ebc19f8e8859) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* Post 3.10.2Pablo Galindo2022-01-141-1/+1
|
* Python 3.10.2v3.10.2Pablo Galindo2022-01-131-2/+2
|
* [3.10] bpo-46006: Revert "bpo-40521: Per-interpreter interned strings ↵Victor Stinner2022-01-061-9/+3
| | | | | | | | | | | | | | | | | (GH-20085)" (GH-30422) (GH-30425) This reverts commit ea251806b8dffff11b30d2182af1e589caf88acf. Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for the main interpreter. Keep _PyUnicode_ClearInterned() changes avoiding the creation of a temporary Python list object. Leave the PyInterpreterState structure unchanged to keep the ABI backward compatibility with Python 3.10.0: rename the "interned" member to "unused_interned". (cherry picked from commit 35d6540c904ef07b8602ff014e520603f84b5886)
* bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059) ↵Miss Islington (bot)2021-12-121-2/+9
| | | | | | | | | (GH-30064) (cherry picked from commit 59435eea08d30796174552c0ca03c59b41adf8a5) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* Post 3.10.1Pablo Galindo2021-12-061-1/+1
|
* Python 3.10.1v3.10.1Pablo Galindo2021-12-061-2/+2
|
* bpo-39026: Fix Python.h when building with Xcode (GH-29488) (GH-29732)Victor Stinner2021-11-252-4/+1
| | | | | | Fix Python.h to build C extensions with Xcode: remove a relative include from Include/cpython/pystate.h. (cherry picked from commit 4ae26b9c1d0c33e3db92c6f305293f9240dea358)
* bpo-45893: Add missing extern C to initconfig.h (GH-29761)Miss Islington (bot)2021-11-241-0/+6
| | | | | | Co-authored-by: Steve Dower <steve.dower@python.org> (cherry picked from commit f4afc53bf68c8ded20b281cd1baa88a679b4a3fd) Co-authored-by: Christian Heimes <christian@python.org>
* [3.10] bpo-45848: Allow the parser to get error lines from encoded files ↵Łukasz Langa2021-11-201-0/+6
| | | | | | | (GH-29646) (GH-29661) (cherry picked from commit fdcc46d9554094994f78bedf6dc9220e5d5ee668) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the ↵Serhiy Storchaka2021-10-141-0/+9
| | | | | | | | | | | "raw-unicode-escape" codec (GH-28944) (GH-28952) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.raw_unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit 39aa98346d5dd8ac591a7cafb467af21c53f1e5d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-45461: Fix IncrementalDecoder and StreamReader in the ↵Miss Islington (bot)2021-10-141-1/+9
| | | | | | | | | | | | "unicode-escape" codec (GH-28939) (GH-28943) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit c96d1546b11b4c282a7e21737cb1f5d16349656d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] Fix typos in the Include directory (GH-28745) (GH-28789)Christian Clauss2021-10-076-7/+7
| | | (cherry picked from commit 8e8f7522171ef82f2f5049940f815e00e38c6f42)
* Post 3.10.0Pablo Galindo2021-10-041-1/+1
|
* Merge tag 'v3.10.0' into 3.10Pablo Galindo2021-10-041-3/+3
|\ | | | | | | Python 3.10.0
| * Python 3.10.0v3.10.0Pablo Galindo2021-10-041-3/+3
| |
| * [3.10] Remove trailing spaces (GH-28709)Serhiy Storchaka2021-10-031-1/+1
| |
| * [3.10] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28511)Łukasz Langa2021-09-292-2/+2
| | | | | | | | | | | | | | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
| * [3.10] bpo-45307: Restore private C API function ↵Serhiy Storchaka2021-09-291-0/+3
| | | | | | | | | | | | | | | | _PyImport_FindExtensionObject() (GH-28594) py2exe and PyOxidizer rely on this API. It will be removed in Python 3.11. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* | [3.10] Remove trailing spaces (GH-28709)Serhiy Storchaka2021-10-031-1/+1
| |
* | closes bpo-44751: Move crypt.h include from public header to _cryptmodule ↵Miss Islington (bot)2021-09-291-13/+0
| | | | | | | | | | | | | | | | (GH-27394) (GH-28636) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e220d6ca030e5a1c8ad63fcaed8e049a98) Co-authored-by: Geoffrey Thomas <geofft@ldpreload.com>
* | [3.10] bpo-45307: Restore private C API function ↵Serhiy Storchaka2021-09-281-0/+3
| | | | | | | | | | | | | | | | _PyImport_FindExtensionObject() (GH-28594) py2exe and PyOxidizer rely on this API. It will be removed in Python 3.11. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* | [3.10] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28511)Łukasz Langa2021-09-212-2/+2
| | | | | | | | | | | | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
* | [3.10] bpo-45083: Include the exception class qualname when formatting an ↵Miss Islington (bot)2021-09-081-0/+2
|/ | | | | | | | | | | | exception (GH-28119) (GH-28134) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> (cherry picked from commit b4b6342848ec0459182a992151099252434cc619) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> * Use a private version of _PyType_GetQualName Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Post 3.10.0rc2Pablo Galindo2021-09-071-1/+1
|
* Python 3.10.0rc2v3.10.0rc2Pablo Galindo2021-09-071-2/+2
|
* bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) ↵Miss Islington (bot)2021-09-071-2/+2
| | | | | | | (GH-28199) Fix PyAiter_Check to only check for the `__anext__` presense (not for `__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`, `PyObject_GetAiter()` -> `PyObject_GetAIter()`.