Commit graph

112151 commits

Author SHA1 Message Date
Miss Islington (bot)
89ea4f92bc
gh-100824: Fix typo in the documentation of unittest.TestLoader.testNamePatterns (GH-100825)
(cherry picked from commit 6d3bc4a795)

Co-authored-by: busywhitespace <busywhitespace@tuta.io>
2023-01-08 00:16:59 -08:00
Alex Waygood
67e52e54bb
[3.10] gh-100673: Removed erroneous note in the get_type_hints docs (#100701) (GH-100826)
Removed erroneous note in the get_type_hints docs

typing.get_type_hints still includes base class type hints.

(cherry picked from commit deaf090699)

Automerge-Triggered-By: GH:AlexWaygood
2023-01-07 12:55:41 -08:00
Miss Islington (bot)
8af15cfc8e
gh-99026 update dataclasses docs for when annotations are inspected (gh-100798)
update dataclasses docs for when annotations are inspected
(cherry picked from commit 659c2607f5)

Co-authored-by: Akshit Tyagi <37214399+exitflynn@users.noreply.github.com>
2023-01-06 06:34:12 -08:00
Carl Meyer
ebe8d23407
[3.10] gh-90104: avoid RecursionError on recursive dataclass field repr (gh-100756) (GH-100785)
Avoid RecursionError on recursive dataclass field repr

(cherry picked from commit 0a7936a38f)

Automerge-Triggered-By: GH:ericvsmith
2023-01-05 18:15:27 -08:00
Miss Islington (bot)
f5fa2c1e7f
gh-87691: clarify use of anchor in pathlib docs (GH-100782)
This is feedback from https://github.com/python/cpython/pull/100737GH-discussion_r1062968696

This matches the wording from the `os.path.join` docs better:
https://docs.python.org/3/library/os.path.htmlGH-os.path.join

In particular, the previous use of "anchor" was incorrect given the
pathlib definition of "anchor".

(cherry picked from commit 2f2fa03ff3)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-01-05 17:56:34 -08:00
Miss Islington (bot)
4bdc57a3d2
gh-87691: add an absolute path pathlib example in / operator docs (GH-100737)
The behaviour is fully explained a couple paragraphs above, but it may be useful to have a brief example to cover the behaviour.
(cherry picked from commit 1ae619c911)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Automerge-Triggered-By: GH:hauntsaninja
2023-01-05 15:04:57 -08:00
Miss Islington (bot)
825ad05e1f
GH-100766: Note that locale.LC_MESSAGES is not universal (GH-100768)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2023-01-05 03:46:29 +00:00
Miss Islington (bot)
f49cc3c805
gh-100739: Respect mock spec when checking for unsafe prefixes (GH-100740)
(cherry picked from commit 7f1eefc6f4)

Co-authored-by: Christian Klein <167265+cklein@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-01-04 15:11:46 -08:00
Miss Islington (bot)
fee4059d21
[3.10] gh-81611: Improve range paragraph in 8.3 of language reference (GH-98353) (#100705)
gh-81611: Improve `range` paragraph in 8.3 of language reference (GH-98353)
(cherry picked from commit 8b1f125121)

Co-authored-by: 4l4k4z4m <alakazamjoined@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-01-04 16:00:27 -05:00
Miss Islington (bot)
8b023134bd
docs: fix ssizeobjargproc parameters (GH-100736)
(cherry picked from commit 5fb1c08e15)

Co-authored-by: David Lechner <david@lechnology.com>
2023-01-04 07:36:44 -08:00
Miss Islington (bot)
35a010f1f9
GH-86508: skip binding to local addresses of different family in asyncio.open_connection (GH-100615)
(cherry picked from commit ba8dcdbcab)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-04 00:24:36 -08:00
Irit Katriel
ff9ac58071
[3.10] gh-95882: Add tests for traceback from contextlib context managers (GH-95883) (#100715) 2023-01-03 22:24:19 +00:00
Zachary Ware
242836c3f2
gh-100700: Remove Date and Release fields in whatsnew/3.9 (GH-100730) 2023-01-03 16:11:18 -06:00
Miss Islington (bot)
a63949374b
fix grammer -> grammar typo in expressions.rst (GH-100683)
(cherry picked from commit 7feb6d2f85)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Automerge-Triggered-By: GH:AlexWaygood
2023-01-02 03:57:22 -08:00
Miss Islington (bot)
c92c5513b3
gh-100428: Make int documentation more accurate (GH-100436)
- Remove first link to lexical definition of integer literal, since it
  doesn't apply (differs in handling of leading zeros, base needs to be
  explicitly specified, unicode digits are allowed)
- Better describe handling of leading zeros, unicode digits, underscores
- Base 0 does not work exactly as like a code literal, since it allows
  Unicode digits. Link code literal to lexical definition of integer
  literal.
(cherry picked from commit edfbf56f4c)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-01-01 19:21:50 -08:00
Miss Islington (bot)
8e386deee9
gh-99953: Purge mention of numeric param style from sqlite3 docs (GH-100630)
The PEP-249 numeric style has never been supported by sqlite3.
(cherry picked from commit b7a68ab824)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-01-01 14:35:46 -08:00
Miss Islington (bot)
fd108e5439
gh-100201: Document behavior with a bare yield statement (GH-100416)
(cherry picked from commit 1aab269d4a)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-01-01 07:42:31 -08:00
Miss Islington (bot)
e3b303a020
gh-96773 Fix documentation of socket backlog (GH-96778)
(cherry picked from commit 1d1480fefc)

Co-authored-by: Mehrdad Moradizadeh <mhrddmoradii@gmail.com>
2023-01-01 07:16:25 -08:00
Miss Islington (bot)
0d57f10e40
IDLE - fix module browser test (GH-100647)
(cherry picked from commit 1f6c87ca7b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-12-31 16:20:53 -08:00
Miss Islington (bot)
f7ad4ffa56
gh-100633 Tutorial: Fix dataclasses import (GH-100638)
import dataclass not dataclasses from dataclasses
(cherry picked from commit 98308dbeb1)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2022-12-31 04:28:36 -08:00
Miss Islington (bot)
504aa92b70
GH-85979: Clarify specification of object.__await__ (GH-22320)
(cherry picked from commit f59c7f8edd)

Co-authored-by: Paolo Lammens <lammenspaolo@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-12-30 22:31:41 -08:00
Miss Islington (bot)
3ab7b61b41
gh-100616: Document 'attr' parameter for window.vline() in curses module (GH-24961)
(cherry picked from commit f4fcfdf8c5)

Co-authored-by: mathieui <mathieui@users.noreply.github.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-12-30 09:05:40 -08:00
Miss Islington (bot)
2b1cc33db0
[3.10] gh-100583: Improve the pydoc documentation (GH-100590) (#100607)
gh-100583: Improve the `pydoc` documentation  (GH-100590)
(cherry picked from commit 7223d50b97)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
2022-12-29 21:45:13 +05:30
Miss Islington (bot)
4217fafeac
GH-100101: Clarify documentation of zip's strict option (GH-100103)
(cherry picked from commit cf1c098180)

Co-authored-by: JustAnotherArchivist <JustAnotherArchivist@users.noreply.github.com>
2022-12-28 13:32:44 -08:00
Miss Islington (bot)
97a3e18c88
gh-55688: Add note about ending backslashes for raw strings (GH-94768)
(cherry picked from commit b95b1b3b25)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2022-12-27 21:39:53 -08:00
Miss Islington (bot)
04285502ba
gh-100553: Improve accuracy of sqlite3.Row iter test (GH-100555)
(cherry picked from commit 3dc48dabd4)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-27 17:16:53 -08:00
Jelle Zijlstra
1ffc67265f
[3.10] gh-99535: Add test for inheritance of annotations and update documentation (GH-99990) (#100509)
(cherry picked from commit f5b7b19bf1)

Co-authored-by: MonadChains <monadchains@gmail.com>
2022-12-26 20:44:53 -08:00
Miss Islington (bot)
bb159b4481
[3.10] gh-100520: Fix rst markup in configparser docstrings (GH-100524) (#100534)
gh-100520: Fix `rst` markup in `configparser`  docstrings (GH-100524)
(cherry picked from commit 199507b81a)

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

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-26 21:12:56 +05:30
Shantanu
a167365d85
[3.10] gh-92446: Improve argparse choices docs (GH-94627) (#100529)
Based on the definition of the collections.abc classes, it is more accurate to use "sequence" instead of "container" when describing argparse choices.

(cherry picked from commit ad3c99e521)

Co-authored-by: Guy Yagev <yourlefthandman8@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-26 01:10:48 -06:00
Shantanu
9975d4e7ba
[3.10] gh-100287: Fix unittest.mock.seal with AsyncMock (GH-100496) (#100508)
(cherry picked from commit e4b43ebb3a)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-24 14:39:27 -06:00
Miss Islington (bot)
ad8d2ef54f
gh-100472: Fix docs claim that compileall parameters could be bytes (GH-100473)
(cherry picked from commit 046cbc2080)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-24 12:29:41 -08:00
Miss Islington (bot)
ecbf136702
[3.10] gh-100474: Fix handling of dirs named index.html in http.server (GH-100504)
Co-authored-by: James Frost <git@frost.cx>
2022-12-24 15:29:21 -05:00
Miss Islington (bot)
0dea92409e
gh-100428: Make float documentation more accurate (GH-100437)
Previously, the grammar did not accept `float("10")`.
Also implement mdickinson's suggestion of removing the indirection.
(cherry picked from commit 2e1a9ce989)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-24 12:15:46 -08:00
Miss Islington (bot)
3ea6f7fee8
gh-99908: Tutorial: Modernize the 'data-record class' example (GH-100499)
(cherry picked from commit 00afa5066b)

Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-24 07:32:29 -08:00
Miss Islington (bot)
ecfe468a6e
gh-77771: Add enterabs example in sched (GH-92716)
(cherry picked from commit 0f6420640c)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-23 21:30:06 -08:00
Miss Islington (bot)
b168b0e013
gh-94808: improve test coverage of number formatting (GH-99472)
(cherry picked from commit 7ca45e5ddd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-23 18:14:14 -08:00
Gregory P. Smith
88fe8d701a
[3.10] Correct CVE-2020-10735 documentation (GH-100306). (#100477)
(cherry picked from commit 1cf3d78c92)

Co-authored-by: Jeremy Paige <ucodery@gmail.com>
2022-12-23 18:08:27 -08:00
Miss Islington (bot)
9c4b8cca09
bpo-40447: accept all path-like objects in compileall.compile_file (GH-19883)
(cherry picked from commit 1ecfd1ebf1)

Co-authored-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@archlinux.org>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-23 12:39:55 -08:00
Miss Islington (bot)
bd472198c6
gh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing docs (GH-98710)
(cherry picked from commit 49f6ff719c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-12-23 07:09:34 -08:00
Miss Islington (bot)
95c55a69b3
[3.10] gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576) (#100451)
gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)

The itemsize returned in a memoryview of a ctypes array is now computed from the item type, instead of dividing the total size by the length and assuming that the length is not zero.
(cherry picked from commit 84bc6a4f25)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
2022-12-23 08:55:55 +00:00
Miss Islington (bot)
86cdfaa885
gh-48496: Added example and link to faq for UnboundLocalError in reference (GH-93068)
(cherry picked from commit f3db68e6e6)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-12-22 15:30:09 -08:00
Miss Islington (bot)
de74d49b21
gh-57762: fix misleading tkinter.Tk docstring (GH-98837)
Mentioned as a desired change by terryjreedy on the corresponding issue,
since Tk is not a subclass of Toplevel.
(cherry picked from commit ad23da0e77)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-22 15:03:38 -08:00
Miss Islington (bot)
58967d1abe
Correct typo in typing.py (GH-100423)
In the docstring of `ParamSpec`, the name of `P = ParamSpec('P')` was
mistakenly written as `'T'`.
(cherry picked from commit 68981578ec)

Co-authored-by: david-why <david_why@outlook.com>
2022-12-22 03:43:55 -08:00
Miss Islington (bot)
2dda6680cc
gh-100129: Add tests for pickling all builtin types and functions (GH-100142)
(cherry picked from commit b98d2d31bf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-21 06:58:31 -08:00
Miss Islington (bot)
7f24056dfb
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
(cherry picked from commit 12be23cf3c)

Co-authored-by: Dominic Socular <BBH@awsl.rip>
2022-12-21 06:06:27 -08:00
colorfulappl
591365cd49
[3.10] gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (GH-99890) (#100386)
(cherry picked from commit efbb1eb9f5)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-21 15:33:21 +05:30
Shantanu
919045cb73
[3.10] gh-85267: Improvements to inspect.signature __text_signature__ handling (GH-98796) (#100393)
This makes a couple related changes to inspect.signature's behaviour
when parsing a signature from `__text_signature__`.

First, `inspect.signature` is documented as only raising ValueError or
TypeError. However, in some cases, we could raise RuntimeError.  This PR
changes that, thereby fixing GH-83685.

(Note that the new ValueErrors in RewriteSymbolics are caught and then
reraised with a message)

Second, `inspect.signature` could randomly drop parameters that it
didn't understand (corresponding to `return None` in the `p` function).
This is the core issue in GH-85267. I think this is very surprising
behaviour and it seems better to fail outright.

Third, adding this new failure broke a couple tests. To fix them (and to
e.g. allow `inspect.signature(select.epoll.register)` as in GH-85267), I
add constant folding of a couple binary operations to RewriteSymbolics.

(There's some discussion of making signature expression evaluation
arbitrary powerful in GH-68155. I think that's out of scope. The
additional constant folding here is pretty straightforward, useful, and
not much of a slippery slope)

Fourth, while GH-85267 is incorrect about the cause of the issue, it turns
out if you had consecutive newlines in __text_signature__, you'd get
`tokenize.TokenError`.

Finally, the `if name is invalid:` code path was dead, since
`parse_name` never returned `invalid`..
(cherry picked from commit 79311cbfe7)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-20 21:25:18 -08:00
Miss Islington (bot)
561e15b857
gh-91081: Add note on WeakKeyDictionary behavior when deleting a replaced entry (GH-91499)
(cherry picked from commit c615286e85)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <P.T.eendebak@tudelft.nl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-12-20 19:34:24 -08:00
Miss Islington (bot)
b3d39c7599
gh-99991: improve docs on str.encode and bytes.decode (GH-100198)
(cherry picked from commit a2bb3b7f9d)

Co-authored-by: Bisola Olasehinde <horlasehinde@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-20 18:11:20 -08:00
Miss Islington (bot)
a757c1b7d3
Clarify that every thread has its own default context in contextvars (GH-99246)
(cherry picked from commit cb60b6131b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-12-20 03:45:48 -08:00