Commit Graph

114069 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 16d8948c31
gh-96385: Correctly raise error on `[*T, *V]` substitution (GH-96386) (#96407)
(cherry picked from commit 75177358a6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-08-30 11:58:54 +01:00
Miss Islington (bot) 8e2d347183
[3.11] gh-91305: Add a note about DatagramHandler and DNS latency. (GH-96380) (GH-96401) 2022-08-30 09:58:37 +01:00
Miss Islington (bot) 53a344ef80
Doc: Update Py_TPFLAGS_HAVE_FINALIZE in docs (GH-96273)
It is now deprecated and the docs should reflect that.
(cherry picked from commit 9625de6fab)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2022-08-30 01:38:40 -07:00
Miss Islington (bot) 1901ee7a52
gh-46845: clean up unused DK_IXSIZE (GH-96405)
(cherry picked from commit d21d2f0793)

Co-authored-by: Matthias Görgens <matthias.goergens@gmail.com>
2022-08-30 00:28:51 -07:00
Miss Islington (bot) 4cfb6395e1
Docs: normalize SQL style in sqlite3 docs (GH-96403)
(cherry picked from commit 6d403e264a)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-08-29 15:59:13 -07:00
Miss Islington (bot) 882c7cf4c7
gh-94682: Build and test with OpenSSL 1.1.1q (gh-94683)
(cherry picked from commit 873554ef84)

Co-authored-by: Christian Heimes <christian@python.org>
2022-08-29 09:47:20 -07:00
Petr Viktorin 626e45564d
gh-90814: Correct NEWS wording re. optional C11 features (GH-96309) (GH-96384)
The previous wording of this entry suggests that CPython
won't work if optional compiler features are enabled.
That's not the case. The change is that we require C11 rather
than C89.

Note that PEP 7 does say "Python 3.11 and newer versions use C11
without optional features." It is correct there: that's
not a guide for users who compile Python, but for CPython devs
who must avoid the features.
2022-08-29 13:27:37 +02:00
Miss Islington (bot) 2ba877258a
gh-95432: Add doctests for the sqlite3 docs (GH-96225)
As a consequence of the added test, this commit also includes
fixes for broken examples.

- Add separate namespace for trace tests bco. module level callback
- Move more backup and cursor examples under separate namespaces
(cherry picked from commit bf9259776d)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-08-29 02:01:37 -07:00
Miss Islington (bot) ca7e78dc3a
GH-96359: Fix docs that claim int(0|1) doesn't match False (GH-96361)
(cherry picked from commit 3d3a86ed40)

Co-authored-by: Jonathan Oberländer <github@l3vi.de>
2022-08-29 00:13:28 -07:00
Dong-hee Na 915d12834f
[3.11] gh-96191: Update the configure file to use GitHub issue (gh-96211) (gh-96375) 2022-08-29 15:50:22 +09:00
Miss Islington (bot) 103f26f282
[3.11] gh-89047: Fix msecs computation so you never end up with 1000 msecs. (GH-96340) (GH-96341) 2022-08-27 15:09:54 +01:00
Miss Islington (bot) 698df306a9
Docs: Fix count of bullets in asyncio-task.rst (GH-96307) (#96330)
(cherry picked from commit 35e4da25d4)

Co-authored-by: zhanpon <pon.zhan@gmail.com>

Co-authored-by: zhanpon <pon.zhan@gmail.com>
2022-08-27 14:26:42 +01:00
Miss Islington (bot) b7ea2b8358
[3.11] gh-92007: Handle elevation errors in NTEventLogHandler more grace… (GH-96322) (GH-96337) 2022-08-27 13:08:14 +01:00
Miss Islington (bot) b76c43a55a
[3.11] gh-77116: Add SMTP buffering example to logging cookbook. (GH-96324) (GH-96326) 2022-08-27 12:15:53 +01:00
Miss Islington (bot) 6bd95f968c
fixes gh-96292: Fix Trivial Typo in cpython/Modules/atexitmodule.c (GH-96327)
(cherry picked from commit 0ace820bec)

Co-authored-by: Ansab Gillani <56605828+ansabgillani@users.noreply.github.com>
2022-08-26 22:59:21 -07:00