Commit graph

114084 commits

Author SHA1 Message Date
Miss Islington (bot)
a2820a0ec8
gh-85299: Add note warning about entry point guard for asyncio example (GH-93457)
(cherry picked from commit 79fd6ccdbe)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-22 20:04:34 +01:00
Miss Islington (bot)
c6df6eecd8
GH-91415: Mention alphabetical sort ordering in the Sorting HOWTO (GH-98336)
(cherry picked from commit ae19217867)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2022-10-22 20:04:33 +01:00
Pablo Galindo
b0925211f4
Post 3.11.0rc2 2022-10-22 20:04:32 +01:00
Pablo Galindo
ed7c3ff156
Python 3.11.0rc2 2022-09-11 20:23:30 +01:00
Miss Islington (bot)
335bd1ee8b
gh-94972: document that shield users need to keep a reference to their task (GH-96724)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
(cherry picked from commit 6281affee6)

Co-authored-by: Hendrik Makait <hendrik.makait@gmail.com>
2022-09-10 08:03:35 -07:00
Miss Islington (bot)
7033dc8adc
GH-96678: Fix undefined behavior in ceval.c (GH-96708)
(cherry picked from commit 50a70a083d)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2022-09-10 06:58:45 -07:00
Miss Islington (bot)
c563b89261
Fix possible NULL pointer dereference in _PyThread_CurrentFrames (GH-96584)
(cherry picked from commit 88a7f661ca)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-09-10 04:12:46 -07:00
Miss Islington (bot)
fecda02eb6
gh-96710: Make the test timing more lenient for the int/str DoS regression test. (GH-96717)
A regression would still absolutely fail and even a flaky pass isn't
harmful as it'd fail most of the time across our N system test runs.

Windows has a low resolution timer and CI systems are prone to odd
timing so this just gives more leeway to avoid flakiness.
(cherry picked from commit 11e3548fd1)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-09-09 13:17:04 -07:00
Mark Shannon
5586da65e2
[3.11] GH-96636: Remove all uses of NOTRACE_DISPATCH (GH-96643) (#96688)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit aa3b4cf779)
2022-09-09 09:24:44 -07:00
Jelle Zijlstra
7bfb11de68
[3.11] io: Add missing f (#96701) 2022-09-09 10:28:26 +01:00
Miss Islington (bot)
99919d4e8a
gh-96352: Set AttributeError context in _PyObject_GenericGetAttrWithDict (GH-96353)
(cherry picked from commit b9634ac776)

Co-authored-by: philg314 <110174000+philg314@users.noreply.github.com>
2022-09-08 04:43:52 -07:00
Miss Islington (bot)
0c443c2315
GH-94808: Test __build_class__ inside non-dict __builtins__ (GH-95932) (#96004)
(cherry picked from commit 3adb4d864b)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-09-08 12:17:18 +01:00
Miss Islington (bot)
1276e73787
gh-95914: Add paragraph about PEP 654 in main body of 'What's New in 3.11' (GH-95937)
(cherry picked from commit 1402d2ceca)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-09-08 04:16:52 -07:00
Miss Islington (bot)
ae819ca6fd
[3.11] gh-68163: Correct conversion of Rational instances to float (GH-25619) (#96556)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2022-09-08 12:03:53 +01:00
Mark Shannon
e72f469e85
[3.11] GH-96569: Avoid undefined behavior (#96616)
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-09-08 12:00:04 +01:00
Miss Islington (bot)
3d6e6beb0d
gh-96652: Fix faulthandler chained signal without sigaction() (GH-96666)
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 c580a81af9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-09-08 03:47:07 -07:00
Miss Islington (bot)
a3d5ecba1c
[3.11] gh-88287: Add BufferingFormatter documentation. (GH-96608) (GH-96675) 2022-09-08 08:30:48 +01:00
Miss Islington (bot)
ffafa9b91d
gh-96268: Fix loading invalid UTF-8 (GH-96270)
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 8bc356a7dd)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-09-07 14:49:17 -07:00
Miss Islington (bot)
9fa21d050a
gh-96577: Fixes buffer overrun in _msi module (GH-96633)
(cherry picked from commit 4114bcc9ef)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-09-07 12:46:09 -07:00
Miss Islington (bot)
295f510f5a
gh-94808: Improve coverage of _PyBytes_FormatEx (GH-95895)
There were two specific areas not covered:

- %(name) syntax
- %*s syntax

Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit dde15f5879)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-09-07 05:18:33 -07:00
Miss Islington (bot)
82284337a4
gh-96641: Do not expose KeyWrapper in _functoolsmodule.c (gh-96642)
(cherry picked from commit 2fd7246e97)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-09-07 04:50:00 -07:00
Miss Islington (bot)
bb0dab5c48
gh-96611: Fix error message for invalid UTF-8 in mid-multiline string (GH-96623)
(cherry picked from commit 05692c67c5)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-09-06 16:40:17 -07:00
Miss Islington (bot)
a389fdb095
GH-96572: fix use after free in trace refs build mode (GH-96618)
(cherry picked from commit 67444902a0)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-09-06 11:28:18 -07:00
Mark Shannon
26dc4dfac3
[3.11] GH-96612: Skip incomplete frames in tracemalloc traces. (GH-96613) (#96617)
(cherry picked from commit 95e271b226)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2022-09-06 18:42:41 +01:00
Batuhan Taskaya
a0848d169b
[3.11] gh-92986: Fix ast.unparse when ImportFrom.level is None (GH-92992) (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 200c9a8da0)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-09-06 13:23:26 +03:00
Miss Islington (bot)
08d8058b79
gh-96559: Fixes Windows launcher handling of defaults using old-style tags, and adds What's New section (GH-96595)
(cherry picked from commit 80a9bd2e94)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-09-05 15:13:24 -07:00
Irit Katriel
a5a9d0517b
[3.11] [doc] Update example in traceback doc (GH-96600) (GH-96603)
This Monty Python reference is of-its-time. It could seem inappropriate in the context of today's sensibilities around mental health.

Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit c4999f261f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-09-05 22:43:27 +01:00
Miss Islington (bot)
c612cc2b5c
Add upstream openssl 1.1.1q patch for trivial build error on macOS (GH-96594)
(cherry picked from commit 991b3712a1)

Co-authored-by: Ned Deily <nad@python.org>
2022-09-05 12:03:53 -07:00
Miss Islington (bot)
d09069abfe
[3.11] gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574) (GH-96575) 2022-09-05 08:03:49 +01:00
Miss Islington (bot)
0c81909a7a
Docs: alphabetically order sqlite3.Cursor attrs (GH-96565)
(cherry picked from commit 9e55685782)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-09-04 14:43:23 -07:00
Miss Islington (bot)
8a776d1d51
gh-95778: Correctly pre-check for int-to-str conversion (GH-96537)
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 b126196838)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2022-09-04 09:45:02 -07:00
Miss Islington (bot)
2ced2c95b7
no-issue: Fix typo in 3.11.0a7.rst (gh-96547)
accross -> across
(cherry picked from commit 6adb89f50a)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2022-09-04 07:26:14 -07:00
Miss Islington (bot)
4587154cb9
gh-95778: remove unneeded doc note on float.as_integer_ratio (GH-96553)
Per mdickinson@'s comment on the main branch PR.
(cherry picked from commit 69bb83c2bf)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-09-04 00:12:00 -07:00
Miss Islington (bot)
c0af099816
doc typo: spell limitation (GH-96542)
(cherry picked from commit af6359dd5c)

Co-authored-by: Mehrdad Moradizadeh <mhrddmoradii@gmail.com>
2022-09-03 23:32:32 -07:00
Vinay Sajip
f255820626
[3.11] gh-90195: Unset logger disabled flag when configuring it. (GH-96530) (GH-96532) 2022-09-03 15:10:50 +01:00
Miss Islington (bot)
79fe67fa04
[3.11] gh-89087: Update logging.QueueHandler documentation to clarify record… (GH-96527) (GH-96528) 2022-09-03 13:16:40 +01:00
Miss Islington (bot)
bc06f5c5f7
gh-75500: Update idlelib/help.html (GH-96523) (#96524)
(cherry picked from commit 837ce6460d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-09-03 10:57:07 +01:00
Miss Islington (bot)
02c59bebf7
bpo-30419: DOC: Update missing information in bdb docs (GH-1687)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ccce9b77e1)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2022-09-02 10:48:26 -07:00
Gregory P. Smith
f8b71da9aa
[3.11] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96500)
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 511ca94520

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#).
2022-09-02 09:48:57 -07:00
Miss Islington (bot)
57116d5682
gh-95180: Add TaskGroup and Runner to AsyncIO API Index (GH-95189)
Also rearrange some items in the list.

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
(cherry picked from commit 2a9e4e4d73)

Co-authored-by: siph <42943030+siphc@users.noreply.github.com>
2022-09-02 09:45:42 -07:00
Miss Islington (bot)
fca8e94dbf
gh-96168: Improve sqlite3 dict_factory example (GH-96457)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 91f40f3f78)

Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no>
2022-09-01 14:55:37 -07:00
Miss Islington (bot)
583591134c
gh-96455: update example in exception_handling_notes.txt to the 3.11RC bytecode (GH-96456)
(cherry picked from commit a91f25577c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-09-01 06:45:09 -07:00
Miss Islington (bot)
d4d5e605cd
gh-96414: Inline code examples in sqlite3 docs (GH-96442)
(cherry picked from commit f7e7bf161a)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-08-30 23:03:33 -07:00
Miss Islington (bot)
895c7a4401
Docs: normalise sqlite3 placeholder how-to heading (GH-96413)
(cherry picked from commit 7b01ce7953)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-08-30 14:06:11 -07:00
Ethan Furman
8f58db2279
[3.11] [Enum] fix check in _test_simple_enum (GH-96435)
The builtin `property` is not a callable, so was failing the check in
`_test_simple_enum` causing a match failure; this adds `property` to the
bypass list.

Co-authored-by: Alexandru Mărășteanu <alexei@users.noreply.github.com>
2022-08-30 12:39:03 -07:00
Miss Islington (bot)
d00a9e0176
gh-95337: update TypeVarTuple example (GH-95338)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 07f12b5c15)

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
2022-08-30 08:06:19 -07:00
Miss Islington (bot)
a1671a97d3
gh-95413: Remove references to deprecated CGI library (GH-95414)
(cherry picked from commit b17aae8bbd)

Co-authored-by: partev <petrosyan@gmail.com>
2022-08-30 04:22:19 -07:00
Miss Islington (bot)
d9d0d097a2
Docs: Improve clarity for bytes.hex() (GH-95257)
(cherry picked from commit 860fa35145)

Co-authored-by: Tim Burke <tim.burke@gmail.com>
2022-08-30 04:18:30 -07:00
Miss Islington (bot)
2e9f29e6a6
GH-74116: Allow multiple drain waiters for asyncio.StreamWriter (GH-94705) (#96395)
(cherry picked from commit e5b2453e61)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-08-30 12:00:21 +01:00
Miss Islington (bot)
126ec34558
gh-90467: StreamReaderProtocol - add strong reference to created task (GH-96323) (#96344)
(cherry picked from commit e860e521ec)

Co-authored-by: Kirill <iam@python273.pw>

Co-authored-by: Kirill <iam@python273.pw>
2022-08-30 11:59:32 +01:00