summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.11.0v3.11.0Pablo Galindo2022-10-2424-71/+255
|
* GH-90985: Revert "Deprecate passing a message into cancel()" (GH-97999)Miss Islington (bot)2022-10-241-0/+1
| | | | | | | Reason: we were too hasty in deprecating this. We shouldn't deprecate it before we have a replacement. (cherry picked from commit 09de8d7aafece264720afbca3052a63eee413b73) Co-authored-by: Guido van Rossum <guido@python.org>
* gh-95027: Fix regrtest stdout encoding on Windows (GH-98492)Miss Islington (bot)2022-10-241-0/+4
| | | | | | | | | On Windows, when the Python test suite is run with the -jN option, the ANSI code page is now used as the encoding for the stdout temporary file, rather than using UTF-8 which can lead to decoding errors. (cherry picked from commit ec1f6f5f139868dc2c1116a7c7c878c38c668d53) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-90989: Clarify some installer text (GH-97668)Steve Dower2022-10-241-0/+1
|
* gh-97616: list_resize() checks for integer overflow (GH-97617)Miss Islington (bot)2022-10-241-0/+3
| | | | | | | | | | | Fix multiplying a list by an integer (list *= int): detect the integer overflow when the new allocated length is close to the maximum size. Issue reported by Jordan Limor. list_resize() now checks for integer overflow before multiplying the new allocated length by the list item size (sizeof(PyObject*)). (cherry picked from commit a5f092f3c469b674b8d9ccbd4e4377230c9ac7cf) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-97545: Make Semaphore run faster. (GH-97549)Miss Islington (bot)2022-10-241-0/+1
| | | | | (cherry picked from commit 68c46ae68b6e0c36a12e37285fff9ce0782ed01e) Co-authored-by: Cyker Way <cykerway@gmail.com>
* gh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (GH-93222)Miss Islington (bot)2022-10-241-0/+1
| | | | | | | | | | | The main problem was that an unluckily timed task cancellation could cause the semaphore to be stuck. There were also doubts about strict FIFO ordering of tasks allowed to pass. The Semaphore implementation was rewritten to be more similar to Lock. Many tests for edge cases (including cancellation) were added. (cherry picked from commit 24e03796248ab8c7f62d715c28156abe2f1c0d20) Co-authored-by: Cyker Way <cykerway@gmail.com>
* gh-96848: Fix -X int_max_str_digits option parsing (GH-96988)Miss Islington (bot)2022-10-221-0/+3
| | | | | | | | Fix command line parsing: reject "-X int_max_str_digits" option with no value (invalid) when the PYTHONINTMAXSTRDIGITS environment variable is set to a valid limit. (cherry picked from commit 41351662bcd21672d8ccfa62fe44d72027e6bcf8) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915) (GH-96927)Miss Islington (bot)2022-10-221-0/+1
| | | | | | | | | | * gh-96821: Assert for demonstrating undefined behaviour * Fix UB (cherry picked from commit cbdeda8ce7a3543cb3376d70e4cd46fcf24f42a7) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Matthias Görgens <matthias.goergens@gmail.com>
* gh-95778: Mention sys.set_int_max_str_digits() in error message (GH-96874)Miss Islington (bot)2022-10-221-0/+3
| | | | | | | When ValueError is raised if an integer is larger than the limit, mention sys.set_int_max_str_digits() in the error message. (cherry picked from commit e841ffc915e82e5ea6e3b473205417d63494808d) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96729: Ensure installers built with Tools/msi/buildrelease.bat have ↵Miss Islington (bot)2022-10-221-0/+2
| | | | | | | matching UUIDs with official releases (GH-96755) (cherry picked from commit 662782e95f97d26bd57b3edc6aaf674e30899f44) Co-authored-by: adang1345 <adang1345@gmail.com>
* [3.11] gh-96587: Raise `SyntaxError` for PEP654 on older `feature_version` ↵Nikita Sobolev2022-10-221-0/+2
| | | | | | | (GH-96588) (#96591) (cherry picked from commit 2c7d2e8d46164efb6e27a64081d8e949f6876515) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK ↵Miss Islington (bot)2022-10-221-0/+6
| | | | | | | | | | | | | (GH-97944) (#97969) The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls. Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a segfault if cpython is built with the macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding runtime support for detection of these system calls ("weaklinking") as is done for other newer syscalls on macOS. (cherry picked from commit 6d0a0191a4e5477bd843e62c24d7f3bcad4fd5fc) Co-authored-by: Ned Deily <nad@python.org>
* gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)Miss Islington (bot)2022-10-221-0/+9
| | | | | (cherry picked from commit b44372e03c5461b6ad3d89763a9eb6cb82df07a4) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.11] gh-98331: Update bundled pip to 22.3 (GH-98332) (gh-98400)Miss Islington (bot)2022-10-221-0/+1
|
* gh-98414: py.exe launcher does not use defaults for -V:company/ option ↵Miss Islington (bot)2022-10-221-0/+3
| | | | | | | (GH-98460) (cherry picked from commit 4bd63f66cd4f6e8d549f88ae0f4b0106d522b6bb) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.11] GH-97752: Clear the previous member of newly-created ↵Miss Islington (bot)2022-10-221-0/+2
| | | | | generator/coroutine frames (GH-97812) (cherry picked from commit 93fcc1f4133e177882850177c2c047d46019b812)
* gh-98360: multiprocessing now spawns children on Windows with correct ↵Miss Islington (bot)2022-10-221-0/+4
| | | | | | | argv[0] in virtual environments (GH-98462) (cherry picked from commit e48f9b2b7e73f4a89a9b9c287f3b93dc13a60460) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.11] gh-97514: Don't use Linux abstract sockets for multiprocessing ↵Miss Islington (bot)2022-10-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | (GH-98501) (GH-98502) Linux abstract sockets are insecure as they lack any form of filesystem permissions so their use allows anyone on the system to inject code into the process. This removes the default preference for abstract sockets in multiprocessing introduced in Python 3.9+ via https://github.com/python/cpython/pull/18866 while fixing https://github.com/python/cpython/issues/84031. Explicit use of an abstract socket by a user now generates a RuntimeWarning. If we choose to keep this warning, it should be backported to the 3.7 and 3.8 branches. (cherry picked from commit 49f61068f49747164988ffc5a442d2a63874fc17) Co-authored-by: Gregory P. Smith <greg@krypto.org> Automerge-Triggered-By: GH:gpshead
* [3.11] GH-97002: Prevent _PyInterpreterFrames from backing more than one ↵Miss Islington (bot)2022-10-221-0/+3
| | | | | PyFrameObject (GH-98002) (cherry picked from commit 21a2d9ff550977f2668e2cf1cc15793bf27fa109)
* GH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97018)Miss Islington (bot)2022-10-221-0/+2
| | | | | (cherry picked from commit 8fd2c3b75b90c4ee391894aa5094615bbdb6242f) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] Use SyntaxError invalid range in tutorial introduction example ↵Miss Islington (bot)2022-10-221-0/+1
| | | | | | | | | | (GH-93031) (GH-97666) Use SyntaxError invalid range in tutorial introduction example (GH-93031) Use output from a 3.10+ REPL, showing invalid range, for the SyntaxError examples in the tutorial introduction page. Co-authored-by: Eddie Hebert <eddie@eddiehebert.com>
* gh-97740: Fix bang in Sphinx C domain ref target syntax (GH-97741)Miss Islington (bot)2022-10-221-0/+2
| | | | | | | | | | | | * gh-97740: Fix bang in Sphinx C domain ref target syntax Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> * Add NEWS entry for C domain bang fix Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> (cherry picked from commit 9148c0d893c7807331fd7be0997261e289074bc5) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Adjust stable ABI internal documentation (GH-96896)Miss Islington (bot)2022-10-221-7/+14
| | | | | | | | I was perusing this file, and noticed that this part of the documentation is slightly out of date: the `struct` items in this TOML file currently contain `struct_abi_kind` members, which distinguish between the different types of ABI compatibility described in the comment. I've updated the comment to reflect this. (cherry picked from commit 6e533088290b909df324615df24286489603989f) Co-authored-by: William Woodruff <william@yossarian.net>
* [3.11] gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) ↵Miss Islington (bot)2022-10-221-1/+1
| | | | | | (GH-97775) (#97873) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C ↵Łukasz Langa2022-10-223-3/+3
| | | | | | | | | | type>) (GH-97768) (#97924) :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 0031e62973801d34a9e19ab7bb199e9668e32d7b) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-86482: Document assignment expression need for ()s (GH-23291)Miss Islington (bot)2022-10-221-0/+1
| | | | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 2b5f1360ead9aa72ae00de59edfd6c229d13933f) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* Python 3.11.0rc2v3.11.0rc2Pablo Galindo2022-09-1140-82/+404
|
* GH-96678: Fix undefined behavior in ceval.c (GH-96708)Miss Islington (bot)2022-09-101-0/+1
| | | | | (cherry picked from commit 50a70a083d34305a52fac4f5901bff2ead152d68) Co-authored-by: Mark Shannon <mark@hotpy.org>
* Fix possible NULL pointer dereference in _PyThread_CurrentFrames (GH-96584)Miss Islington (bot)2022-09-101-0/+1
| | | | | (cherry picked from commit 88a7f661ca02c0eb76b8f19234b8293b70f171e2) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] GH-96636: Remove all uses of NOTRACE_DISPATCH (GH-96643) (#96688)Mark Shannon2022-09-091-0/+3
| | | | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit aa3b4cf779b3dddb84e094879b91703354910d8c)
* [3.11] io: Add missing f (#96701)Jelle Zijlstra2022-09-091-0/+1
|
* gh-96352: Set AttributeError context in _PyObject_GenericGetAttrWithDict ↵Miss Islington (bot)2022-09-081-0/+2
| | | | | | | (GH-96353) (cherry picked from commit b9634ac776c24bc4d4a57859d884a94cdfe16043) Co-authored-by: philg314 <110174000+philg314@users.noreply.github.com>
* [3.11] gh-68163: Correct conversion of Rational instances to float ↵Miss Islington (bot)2022-09-081-0/+1
| | | | | | (GH-25619) (#96556) Co-authored-by: Mark Dickinson <dickinsm@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.11] GH-96569: Avoid undefined behavior (#96616)Mark Shannon2022-09-081-0/+1
| | | Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* gh-96652: Fix faulthandler chained signal without sigaction() (GH-96666)Miss Islington (bot)2022-09-081-0/+3
| | | | | | | | Fix the faulthandler implementation of faulthandler.register(signal, chain=True) if the sigaction() function is not available: don't call the previous signal handler if it's NULL. (cherry picked from commit c580a81af91af4b9df85e466f8b48c3c9c86c3df) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96268: Fix loading invalid UTF-8 (GH-96270)Miss Islington (bot)2022-09-071-0/+2
| | | | | | | | This makes tokenizer.c:valid_utf8 match stringlib/codecs.h:decode_utf8. It also fixes an off-by-one error introduced in 3.10 for the line number when the tokenizer reports bad UTF8. (cherry picked from commit 8bc356a7dd50cbdb46d10b8c7e457832431f5d9e) Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* gh-96577: Fixes buffer overrun in _msi module (GH-96633)Miss Islington (bot)2022-09-071-0/+1
| | | | | (cherry picked from commit 4114bcc9ef7595a07196bcecf9c7d6d39f57f64d) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642)Miss Islington (bot)2022-09-071-0/+1
| | | | | (cherry picked from commit 2fd7246e97c8cc09b4e3f22933693f9d68f08163) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-96611: Fix error message for invalid UTF-8 in mid-multiline string (GH-96623)Miss Islington (bot)2022-09-061-0/+2
| | | | | (cherry picked from commit 05692c67c51b78a5a5a7bb61d646519025e38015) Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* GH-96572: fix use after free in trace refs build mode (GH-96618)Miss Islington (bot)2022-09-061-0/+1
| | | | | (cherry picked from commit 67444902a0f10419a557d0a2d3b8675c31b075a9) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] GH-96612: Skip incomplete frames in tracemalloc traces. (GH-96613) ↵Mark Shannon2022-09-061-0/+1
| | | | | | | (#96617) (cherry picked from commit 95e271b2266b8f2e7b60ede86ccf3ede4a7f83eb) Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] gh-92986: Fix ast.unparse when ImportFrom.level is None (GH-92992) ↵Batuhan Taskaya2022-09-061-0/+1
| | | | | | | | | | | | (GH-96593) This doesn't happen naturally, but is allowed by the ASDL and compiler. We don't want to change ASDL for backward compatibility reasons (GH-57645, GH-92987) (cherry picked from commit 200c9a8da0e2b892c476807e986009c01327e781) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-96559: Fixes Windows launcher handling of defaults using old-style tags, ↵Miss Islington (bot)2022-09-051-0/+3
| | | | | | | and adds What's New section (GH-96595) (cherry picked from commit 80a9bd2e94b1759a7669fa811ed3526eb137c92d) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-95778: Correctly pre-check for int-to-str conversion (GH-96537)Miss Islington (bot)2022-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* no-issue: Fix typo in 3.11.0a7.rst (gh-96547)Miss Islington (bot)2022-09-041-1/+1
| | | | | | accross -> across (cherry picked from commit 6adb89f50a0b032e0264cb3cd400a71c0fe6e0f8) Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
* [3.11] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96500)Gregory P. Smith2022-09-021-0/+14
| | | | | | | | | | | | | | | | | | 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#).
* GH-74116: Allow multiple drain waiters for asyncio.StreamWriter (GH-94705) ↵Miss Islington (bot)2022-08-301-0/+1
| | | | | | | | | (#96395) (cherry picked from commit e5b2453e61ba5376831093236d598ef5f9f1de61) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-90467: StreamReaderProtocol - add strong reference to created task ↵Miss Islington (bot)2022-08-302-0/+4
| | | | | | | | | (GH-96323) (#96344) (cherry picked from commit e860e521ec0d84e175269aeb15cf24bd6053ad17) Co-authored-by: Kirill <iam@python273.pw> Co-authored-by: Kirill <iam@python273.pw>
* gh-96385: Correctly raise error on `[*T, *V]` substitution (GH-96386) (#96407)Miss Islington (bot)2022-08-301-0/+3
| | | | | | | (cherry picked from commit 75177358a62afeabd1d3aa0e9f395c2b9d4495ca) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>