Commit graph

114046 commits

Author SHA1 Message Date
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
Miss Islington (bot)
0bc0b732ee
fix threading.Event.isSet() docstring (GH-96297)
fixes gh-96296
(cherry picked from commit e534440510)

Co-authored-by: Daniel Giger <danielg3432@gmail.com>
2022-08-26 22:32:03 -07:00
Miss Islington (bot)
f0469c7424
gh-95994: Clarify escaped newlines. (GH-96066)
* gh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit c3d591fd06)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-08-26 12:11:59 -07:00
Miss Islington (bot)
acd7841aa4
Port regression test for issue GH-93592 (GH-96208) (GH-96313) 2022-08-26 16:02:36 +01:00
Miss Islington (bot)
315807dac9
gh-96197: Define the behavior of repr if sys.displayhook is lost (gh-96242)
(cherry picked from commit 0319cd6825)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-08-25 19:12:43 -07:00
Miss Islington (bot)
7604456f24
bpo-46744: Support "-Win32" and make platform flags case insensitive in Windows build scripts. (GH-31803)
(cherry picked from commit 1288097088)

Co-authored-by: conioh <10606081+conioh@users.noreply.github.com>
2022-08-25 12:50:48 -07:00
Miss Islington (bot)
3d14b4fecb
Clarify API stability of PyTypeObject in relation to static types. (GH-96217)
Fixes:
https://github.com/python/cpython/issues/95300

Related:
https://github.com/python/cpython/issues/91271
(cherry picked from commit caa2a9799a)

Co-authored-by: ov2k <ov2k.github@gmail.com>
2022-08-25 06:42:14 -07:00
Miss Islington (bot)
888054ae8a
[3.11] gh-91070: Add note about SysLogHandler on macOS 12.x (Monterey). (GH-94803) (GH-96260) 2022-08-25 08:38:02 +01:00
Miss Islington (bot)
f51216df07
gh-96021: Explicitly close the IsolatedAsyncioTestCase runner in tests (GH-96135)
Tests for IsolatedAsyncioTestCase.debug() rely on the runner be closed
in __del__. It makes tests depending on the GC an unreliable on other
implementations. It is better to close the runner explicitly even if
currently there is no a public API for this.
(cherry picked from commit 4de06e3cc0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-08-24 21:53:39 -07:00
Miss Islington (bot)
915ee9ed43
gh-95243: Mitigate the race condition in testSockName (GH-96173)
find_unused_port() has an inherent race condition, but we can't use
bind_port() as that uses .getsockname() which this test is exercising.

Try binding to unused ports a few times before failing.

Signed-off-by: Ross Burton <ross.burton@arm.com>
(cherry picked from commit df11012697)

Co-authored-by: Ross Burton <ross.burton@arm.com>
2022-08-24 19:03:29 -07:00
Miss Islington (bot)
d02e8fbc5a
GH-96179: Fix misleading example on the bisect documentation (GH-96228)
The `movies[bisect(movies, 1960, key=by_year)]` will actually return only movies **after** 1960.
(cherry picked from commit 4317b25a23)

Co-authored-by: prego <pedropregueiro@gmail.com>
2022-08-24 08:54:15 -07:00
Miss Islington (bot)
bf2728b9f1
gh-96197: Define the behavior of breakpoint if sys.breakpointhook is lost (gh-96231)
(cherry picked from commit 09563a764e)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-08-24 07:20:22 -07:00
Erlend E. Aasland
2b8fd74548
[3.11] gh-94635: Frame sqlite3 how-to headings as such & move default adapters to reference (GH-96136) (#96226)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>.
(cherry picked from commit 6bda5b85b5)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-08-24 09:51:46 +02:00
Miss Islington (bot)
c01fc9d30a
[3.11] gh-96189: Fix test_invalid_utf8 on a number of build bots (GH-96190) (#96218)
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-08-23 23:28:44 +01:00
Miss Islington (bot)
d7eea0f1ca
gh-96175: add missing self._localName assignment in xml.dom.minidom.Attr (GH-96176)
X-Ref: https://github.com/python/typeshed/pull/8590GH-discussion_r951473977

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 58f6953d6d)

Co-authored-by: Kevin Kirsche <Kev.Kirsche+GitHub@gmail.com>
2022-08-23 10:18:19 -07:00
Miss Islington (bot)
0aed1e71f3
GH-96071: add regression test for GH-96071 (GH-96137)
Automerge-Triggered-By: GH:ericsnowcurrently
(cherry picked from commit 079baee196)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-08-23 08:37:19 -07:00
Miss Islington (bot)
27950d8f76
GH-96187: Prevent _PyCode_GetExtra to return garbage for negative indexes (GH-96188)
(cherry picked from commit 16ebae4cd4)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-08-23 04:02:19 -07:00
Miss Islington (bot)
04e3785098
[3.11] gh-96159: Fix significant performance degradation in logging.TimedRotat… (GH-96182) (GH-96196)
Co-authored-by: Duncan Grisby <duncan-github@grisby.org>
2022-08-23 08:01:10 +01:00
Miss Islington (bot)
dc6391705e
gh-96096: Add undocumented SQLITE_OK/DENY/IGNORE sqlite3 constants (GH-96134)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit d6259c58cb)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-08-22 23:58:35 -07:00
Miss Islington (bot)
88a559ffea
gh-95432: Add doctest for sqlite3 tutorial (GH-96193)
(cherry picked from commit 04c73e5efb)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-08-22 23:55:35 -07:00
Miss Islington (bot)
4f7f83b5bd
gh-96076: Change test_launcher to use non-admin location for py.ini (GH-96091)
Patch authored by Eryksun.
(cherry picked from commit 216ccacda1)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-08-22 09:49:34 -07:00
Miss Islington (bot)
3ea0beb359
gh-96046: Initialize ht_cached_keys in PyType_Ready() (GH-96047)
(cherry picked from commit 53e6a9a725)

Co-authored-by: Christian Heimes <christian@python.org>
2022-08-22 02:12:42 -07:00
Miss Islington (bot)
98622fa00e
gh-96121: Merge sqlite3.Row examples into sqlite3.Row class doc (GH-96122)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit 18b1782192)

Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no>
2022-08-22 01:12:02 -07:00
Miss Islington (bot)
fedd25eb64
small grammatical change (GH-96138) (GH-96157) 2022-08-21 15:55:00 -05:00