Commit graph

12812 commits

Author SHA1 Message Date
Sebastian Pipping
0a01ed6c2a
[3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248)
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:

- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`

Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .

- Please treat as a security fix related to CVE-2023-52425.

(cherry picked from commit 6a95676bb5)
(cherry picked from commit 73807eb634)
(cherry picked from commit eda2963378)

---------

Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-06 22:01:45 +00:00
Miss Islington (bot)
23a9ba45ae
[3.12] gh-115986: Fix inaccuracies in pprint docs (GH-116104) (#116382)
Amend wording after gh-116019 was merged.
(cherry picked from commit e205c5cd8f)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
2024-03-05 21:20:51 +00:00
Terry Jan Reedy
84b023d243
[3.12] chore: fix typos (#116345) (#116370)
Co-authored-by: cui fliter <imcusg@gmail.com>
(cherry picked from commit e7ba6e9dbe)
2024-03-05 18:51:17 +00:00
Miss Islington (bot)
0f5cd44e1c
[3.12] gh-115777: Fix double versionadded directives (GH-116269) (GH-116361)
(cherry picked from commit 0064dfa091)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-05 16:00:40 +00:00
Miss Islington (bot)
0a9356ce6d
[3.12] Consistently spell out *predicate* instead of *pred*. (gh-116308) (gh-116312) 2024-03-04 16:18:52 +00:00
AN Long
eb0603b855
gh-104711: Add security warning to the CGIHTTPRequestHandler document (GH-115915)
(cherry picked from commit dac8ff4c40)
2024-03-04 11:54:38 +00:00
Miss Islington (bot)
e95e837541
[3.12] gh-116281: Remove wrong '\' from '\*' in some doc signatures (GH-116282) (#116285)
gh-116281: Remove wrong '\' from '\*' in some doc signatures (GH-116282)
(cherry picked from commit 4859ecb860)

Co-authored-by: HarryLHW <123lhw321@gmail.com>
2024-03-03 14:42:22 -05:00
Miss Islington (bot)
16be4a3b93
[3.12] gh-116035: Document that both tzinfo and fold are ignored in comparisons if tzinfo is the same (GH-116187) (GH-116216)
This mostly restores information removed in c12240ed28 (GH-114749).
(cherry picked from commit 05b04903a1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-01 19:26:17 +02:00
Miss Islington (bot)
753b6644e3
[3.12] gh-115811: Update documentation to add some Logger attributes. (GH-116109) (GH-116185)
(cherry picked from commit 3b6f4cadf1)
2024-03-01 08:57:30 +00:00
Shantanu
2cf68dbe29
[3.12] gh-115881: Document feature_version limitations (#115980) (#116173) 2024-03-01 01:56:06 +00:00
Miss Islington (bot)
8d865f19bd
[3.12] Fix rendering of null character in ast.rst (GH-116080) (#116160)
Fix rendering of null character in ast.rst (GH-116080)
(cherry picked from commit c04a981ff4)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-02-29 22:42:25 +00:00
Miss Islington (bot)
811f4bd5a7
[3.12] gh-73580: Docs for tunnelling TLS through TLS (GH-22539) (GH-116149)
(cherry picked from commit 91c3c64237)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
2024-02-29 21:04:02 +00:00
Miss Islington (bot)
240e5f613b
[3.12] Docs: mark up NotImplemented using the :data: role throughout the docs (GH-116135) (#116147)
(cherry picked from commit dbe44f150c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-29 20:53:51 +00:00
Miss Islington (bot)
010aac7c1a
[3.12] Make the iter_except() recipe more compact. (gh-116132) (gh0116133) 2024-02-29 17:37:00 +00:00
Miss Islington (bot)
31462d4de2
[3.12] gh-115937: Remove implementation details from inspect.signature() docs (GH-116086) (#116106)
gh-115937: Remove implementation details from inspect.signature() docs (GH-116086)
(cherry picked from commit fb2e17b642)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-29 01:54:36 -08:00
Miss Islington (bot)
d4a1c8e628
[3.12] Update an out-of-date example in the itertools recipe intro (gh-116082) (gh-116084) 2024-02-28 17:19:17 -06:00
Ethan Furman
83ff92d225
[3.12] gh-115821: [Enum] better error message for calling super().__new__() (GH-116065)
Add note to not call super().__new__() in docs.
2024-02-28 15:17:20 -08:00
Miss Islington (bot)
a85e512699
[3.12] Improve all_equal() recipe (gh-116081) (gh-116083) 2024-02-28 17:11:46 -06:00
Miss Islington (bot)
91e680b85c
[3.12] GH-115986 Reorder pprint docs and amend some references (GH-116019) (#116061)
GH-115986 Reorder pprint docs and amend some references (GH-116019)

Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.

Also:
- Fix pprint.pprint() references so they properly link to the module
  level function.
- Add links to sys.stdout.
(cherry picked from commit 6c1c94dc51)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
2024-02-28 21:06:08 +01:00
Miss Islington (bot)
9df6d1e033
[3.12] doc: Use super() in subclassed JSONEncoder examples (GH-115565) (GH-116047)
doc: Use super() in subclassed JSONEncoder examples (GH-115565)

Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.
(cherry picked from commit 647053fed1)

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2024-02-28 14:13:08 +00:00
Miss Islington (bot)
96f98d9777
[3.12] gh-115315: Update time.rst to include microseconds field (%f) in chart (GH-115316) (#115990)
Co-authored-by: Tahoma Software <bacon@tahoma.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-27 15:40:17 +02:00
Miss Islington (bot)
79061af448
[3.12] gh-115091: Remove a left-over sentence that refers to Py_OptimizeFlag from ctypes documentation (GH-115092) (GH-115936)
Remove a left-over sentence that refers to an example that was present in Python 3.10 and was using ``Py_OptimizeFlag``.
(cherry picked from commit 915d7dd090)

Co-authored-by: Antti Haapala <antti.haapala@interjektio.fi>
2024-02-26 11:09:14 +01:00
Miss Islington (bot)
daa28d7552
[3.12] Doc: Clarify the return type of Event.wait when timeout is used (GH-104168) (GH-115938)
(cherry picked from commit 37f5d06b1b)

Co-authored-by: Phil Elson <pelson.pub@gmail.com>
2024-02-26 09:59:26 +00:00
Miss Islington (bot)
f1b3b346eb
[3.12] gh-115921: Change 'equation' to 'expression' in random.rst (GH-115927) (#115928)
In uniform function entry.
(cherry picked from commit de0b4f95cb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-02-26 03:57:09 +00:00
Carol Willing
7307b562b0
[3.12] gh-101100: Fix broken xrefs in fcntl module doc (GH-115691) (#115924)
* clean up fcntl module doc

* simplify

* a few changes, based on suggestion by CAM-Gerlach

* nitpick ignore for a couple other C functions mentioned in the fcntl module doc

* more changes, especially related to LOCK_* constants

* :data: back to :const:

* Apply suggestions from code review



---------

(cherry picked from commit 84a275c4a2)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-02-25 17:27:35 -08:00
Miss Islington (bot)
124594913d
[3.12] gh-113479: Link to workaround for subtle issue with takewhile() (gh-115890) (gh-115910) 2024-02-25 12:38:15 +00:00
Miss Islington (bot)
f684e257b1
[3.12] gh-103417: Fix the scheduler example (GH-111497) (GH-115908)
Arguments to enterabs() are specified as Unix time.
If the scheduler use the time.monotonic timer, the code will take
decades to complete.
(cherry picked from commit cb287d3421)

Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com>
2024-02-25 14:04:32 +02:00
Miss Islington (bot)
041d85fea2
[3.12] Add an example of of custom __repr__ (GH-112761) (#115900)
Added to repr entry in Doc/library/functions.rst.

---------

(cherry picked from commit 5770006ffa)

Co-authored-by: Oh seungmin <tmdals179@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-02-25 08:05:39 +00:00
Miss Islington (bot)
59ec6e8f23
[3.12] Erase some unnecessary quotes on data model doc (GH-113521) (#115896)
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.

(cherry picked from commit f7455864f2)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-02-24 23:30:14 -05:00
Miss Islington (bot)
71b75f6f15
[3.12] Update http.cookiejar document for cookie object attributes (GH-101885) (#115833)
Update http.cookiejar document for cookie object attributes (GH-101885)
(cherry picked from commit a3859422d1)

Co-authored-by: NewUserHa <32261870+NewUserHa@users.noreply.github.com>
2024-02-23 14:11:59 -08:00
Miss Islington (bot)
10907bdad3
[3.12] gh-54358: Clarify data chunking in pyexpat (GH-31629) (GH-115864)
(cherry picked from commit 462a2fc09d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Éric Araujo <merwok@netwok.org>
2024-02-23 21:25:56 +02:00
Miss Islington (bot)
cab8d07d17
[3.12] gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400) (GH-115760)
Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"
(cherry picked from commit fbd40ce46e)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-02-21 12:43:05 +01:00
Miss Islington (bot)
b7c633fbfc
[3.12] gh-112020: Document the meaning of empty bytes returned by socket.recv() (GH-112055) (GH-115722)
(cherry picked from commit e71468ba4f)

Co-authored-by: talcs <talh8787@gmail.com>
2024-02-20 15:01:31 +00:00
Miss Islington (bot)
db145c72b8
[3.12] Fix typo in multiprocessing docs (GH-115650) (#115679)
(cherry picked from commit 57d31ec359)

Co-authored-by: Naglis Jonaitis <827324+naglis@users.noreply.github.com>
2024-02-19 18:25:24 +00:00
Miss Islington (bot)
b434439bfb
[3.12] gh-115664: Fix versionadded and versionchanged directives in multiprocessing.rst (GH-115665) (GH-115677)
(cherry picked from commit 8f602981ba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-19 20:21:10 +02:00
Brian Schubert
773d53d3c1
[3.12] gh-115664: Fix chronological ordering of versionadded and versionchanged directives (GH-115676) (#115678) 2024-02-19 18:18:38 +00:00
Miss Islington (bot)
94d1a7b853
[3.12] gh-115652: Fix indentation in the documentation of multiprocessing.get_start_method (GH-115658) (GH-115659)
(cherry picked from commit d504968983)

Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
2024-02-19 17:09:21 +02:00
Miss Islington (bot)
8a5731e7db
[3.12] Docs: Add explanation about little/big endian (GH-109841) (#115646)
Docs: Add explanation about little/big endian (GH-109841)
(cherry picked from commit 177b9cb52e)

Co-authored-by: Simon A. Eugster <simon.eu@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-02-19 07:56:54 +00:00
Kirill Podoprigora
ae6c01d9d2
[3.12] gh-115572: Move codeobject.replace() docs to the data model … (#115633)
* [3.12] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4c14)

Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>

* Remove note about copy.replace

---------

Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>
2024-02-18 14:38:33 +00:00
Miss Islington (bot)
c726d1cc67
[3.12] Document use of ANY in test assertions (GH-94060) (GH-115607)
(cherry picked from commit 04005f5021)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2024-02-17 13:24:20 +00:00
Miss Islington (bot)
a086dd313e
[3.12] gh-101699: Explain using Match.expand with \g<0> (GH-101701) (GH-115583)
Update documentation for re library to explain that a backreference `\g<0>` is
expanded to the entire string when using Match.expand().
Note that numeric backreferences to group 0 (`\0`) are not supported.

(cherry picked from commit d2d7808853)

Co-authored-by: Stevoisiak <S.Vascellaro@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-17 15:04:09 +02:00
Miss Islington (bot)
068e2190de
[3.12] gh-87688: Amend SSLContext.hostname_checks_common_name docs (GH-100517) (GH-115594)
(cherry picked from commit debb1386be)

Co-authored-by: Rami <72725910+ramikg@users.noreply.github.com>
2024-02-17 14:59:59 +02:00
Miss Islington (bot)
7218b81614
[3.12] gh-56499: Update the pickle library's note section for the __setstate__ function (GH-101062) (GH-115597)
(cherry picked from commit d5a30a1777)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-02-17 14:57:22 +02:00
Miss Islington (bot)
d46a2a0008
[3.12] gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825) (GH-115601)
Since 2f3941d743 this function returns the
response string, rather than nothing.
(cherry picked from commit e88ebc1c40)

Co-authored-by: Matthew Hughes <34972397+matthewhughes934@users.noreply.github.com>
2024-02-17 14:54:50 +02:00
Miss Islington (bot)
d08d5b6251
[3.12] docs: Add glossary term references to shutil docs (GH-115559) (#115578)
docs: Add glossary term references to shutil docs (GH-115559)

Add glossary term references to shutil docs
(cherry picked from commit 318f2190bc)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-16 22:12:49 +00:00
Miss Islington (bot)
7d9ce3c867
[3.12] Docs: spell out sentence about ndbm/gdbm file formats (GH-115470) (#115476)
(cherry picked from commit 49e8fdc1df)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-14 18:11:43 +00:00
Miss Islington (bot)
59317167eb
[3.12] Docs: reword sentences about dbm submodule traits (GH-114609) (#115462)
Don't repeatedly say that keys and values are coerced into bytes.
(cherry picked from commit 81e140d10b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-14 15:55:48 +00:00
Miss Islington (bot)
d5f7b07e92
[3.12] gh-115403: Remove extra colon after "Examples" in datetime documentation (GH-115452) (#115455)
gh-115403: Remove extra colon after "Examples" in datetime documentation (GH-115452)
(cherry picked from commit 6755c4e0c8)

Co-authored-by: Stanislav Lyu <wallseat@gmail.com>
2024-02-14 17:07:55 +03:00
Miss Islington (bot)
644aeb5dbb
[3.12] ftplib docs: timeout doesn't have to be a whole number (GH-115443) (#115445)
ftplib docs: `timeout` doesn't have to be a whole number (GH-115443)
(cherry picked from commit 3fd2ad8241)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-14 10:47:59 +00:00
Hugo van Kemenade
5ec271db3b
[3.12] gh-101100: Fix Sphinx warnings in whatsnew/2.7.rst and related (GH-115319) (#115330) 2024-02-12 16:37:20 +02:00