Commit graph

110822 commits

Author SHA1 Message Date
Miss Islington (bot)
10343bd983
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but init=False (GH-29692)
Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
(cherry picked from commit d3062f672c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2021-11-22 05:47:41 -08:00
Miss Islington (bot)
9e7a2e4920
Fix out-of-tree build support for multissltest (GH-29694)
(cherry picked from commit 512dbf6f56)

Co-authored-by: Christian Heimes <christian@python.org>
2021-11-22 02:14:28 -08:00
Pablo Galindo Salgado
07cf66fd03
[3.10] Ensure the str member of the tokenizer is always initialised (GH-29681). (GH-29683)
(cherry picked from commit 4f006a789a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-21 04:15:22 +00:00
Miss Islington (bot)
9841ac2da5
bpo-45852: Fix the Counter/iter test for statistics.mode() (GH-29667) (GH-29671)
Suggested by Stefan Pochmann.
(cherry picked from commit 48744db70e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-11-20 18:27:44 -06:00
Miss Islington (bot)
cf8c8788c9
Added kw_only parameter to make_dataclasses. (GH-29679)
(cherry picked from commit f7638dd0f9)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2021-11-20 15:46:56 -08:00
Miss Islington (bot)
3528df1258
[3.10] bpo-45845: Change link for pyserial (GH-29675)
(cherry picked from commit 123a3527dd)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-11-20 15:51:24 -05:00
Miss Islington (bot)
edabf39046
bpo-45845: Remove unresponsive web link (GH-29651) (GH-29674)
Threading notes by Aahz from OSCON 2001.

(cherry picked from commit 9852339145)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-11-20 13:50:24 -05:00
Miss Islington (bot)
a427eb862f
bpo-45494: Fix error location in EOF tokenizer errors (GH-29108)
(cherry picked from commit 79ff0d1687)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-20 09:59:34 -08:00
Pablo Galindo Salgado
511ee1c0fa
[3.10] bpo-45727: Make the syntax error for missing comma more consistent (GH-29427) (GH-29647)
(cherry picked from commit 546cefcda7)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-20 17:39:17 +00:00
Miss Islington (bot)
82f1a6edfb
bpo-45846: Fix capitalisation of Van Rossum at the start of sentence (GH-29641) (GH-29656)
(cherry picked from commit bc2bc0dbdb)

Co-authored-by: JMcB <joel.mcbride1@live.com>
2021-11-20 16:57:16 +01:00
Łukasz Langa
904af3de2b
[3.10] bpo-45848: Allow the parser to get error lines from encoded files (GH-29646) (GH-29661)
(cherry picked from commit fdcc46d955)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-20 16:34:56 +01:00
Miss Islington (bot)
bbe3c57c86
bpo-19072: Classmethod can wrap other classmethod like descriptors (GH-29634) (GH-29643)
staticmethod() also became callable in Python 3.10.

See: b83861f02.
(cherry picked from commit e34809e1c2)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-11-19 20:12:16 +01:00
Hugo van Kemenade
9501e8d3a3
bpo-45837: Note tiltangle is not deprecated, it's really settiltangle (GH-29629) 2021-11-19 19:55:40 +01:00
Miss Islington (bot)
2a630e716e
[3.10] bpo-45788: Link sys.prefix doc to 'Installation paths' (GH-29606)
... To the Installation paths section of the sysconfig doc.
(cherry picked from commit 4575c01b75)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-11-18 16:46:06 -05:00
Miss Islington (bot)
fde9f61e70
[3.10] [doc] bpo-45680: Disambiguate `__getitem__ and __class_getitem__` in the data model (GH-29389) (GH-29620)
The documentation explaining Python's data model does not adequately explain
the differences between ``__getitem__`` and ``__class_getitem__``, nor does it
explain when each is called. There is an attempt at explaining
``__class_getitem__`` in the documentation for ``GenericAlias`` objects, but
this does not give sufficient clarity into how the method works. Moreover, it
is the wrong place for that information to be found; the explanation of
``__class_getitem__`` should be in the documentation explaining the data model.

This PR has been split off from GH-29335.
(cherry picked from commit 31b3a70edb)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 18:34:08 +01:00
Miss Islington (bot)
252d83cbf1
bpo-45640: [docs] Tokens are now clickable (GH-29260) (GH-29621)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 32959108f9)

Co-authored-by: Arthur Milchior <arthur@milchior.fr>
2021-11-18 17:28:39 +01:00
Miss Islington (bot)
02531f1d7e
[doc] Expand on soft keywords in the docs for keyword.py (GH-29139) (GH-29195)
Add link at the top and fix the existing links to point to the "[soft keywords](https://docs.python.org/3.10/reference/lexical_analysis.htmlGH-soft-keywords)" section created in the Python 3.10 docs.

(cherry picked from commit 9e05da6224)

Co-authored-by: William Andrea <william.j.andrea@gmail.com>
2021-11-18 17:23:03 +01:00
Miss Islington (bot)
6d66de97f8
bpo-44959: Add fallback to extension modules with '.sl' suffix on HP-UX (GH-27857) (GH-29152)
(cherry picked from commit 2396fa6537)

Co-authored-by: Florin Spătar <florin.spatar@gmail.com>
2021-11-18 17:19:19 +01:00
Miss Islington (bot)
0df5d31ac7
bpo-45701: Improve documentation for *typed* parameter (GH-29498) (GH-29509)
(cherry picked from commit 912a4ccc3a)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-11-18 17:12:07 +01:00
Miss Islington (bot)
5cf05c71d1
bpo-45835: Fix race condition in test_queue (GH-29601) (GH-29612)
Some of the tests in test_queue had a race condition in which a
non-sentinel value could be enqueued after the final sentinel value
leading to not all the inputs being processed (and test failures).

This changes feed() to enqueue a sentinel once the inputs are exhausted,
which guarantees that the final queued object is a sentinel. This
requires the number of feeder threads to match the number of consumer
threads, but that's already the case in the relevant tests.
(cherry picked from commit df3e53d86b)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-18 17:05:40 +01:00
Ethan Furman
65c089751b
[3.10] [Enum] update member.member removal (GH-29608)
Accessing one enum member from another originally raised an `AttributeError`, but became possible due to a performance boost implementation detail.  In 3.11 it will again raise an `AttributeError`.
2021-11-17 23:38:56 -08:00
Łukasz Langa
8eabe60108
[3.10] bpo-45826: Fix a crash in suggestions.c by checking for traceback is None (GH-29590) (GH-29602)
(cherry picked from commit 5d90c467c0)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-11-18 01:28:04 +01:00
Miss Islington (bot)
563e45875a
[docs] Add missing word "any" in unittest -k cmdline option description (GH-29571) (GH-29603)
(cherry picked from commit abc0d754c3)

Co-authored-by: ch33zer <ch33zer@gmail.com>
2021-11-18 01:25:54 +01:00
Miss Islington (bot)
b455df59a8
bpo-45820: Fix a segfault when the parser fails without reading any input (GH-29580)
(cherry picked from commit df4ae55e66)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-17 15:43:14 -08:00
Pablo Galindo Salgado
e3aa9fd77b
[3.10] bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are not provided (GH-29582) (GH-29586)
(cherry picked from commit da20d7401d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-18 00:17:18 +01:00
Miss Islington (bot)
4ffde90dcc
bpo-45831: _Py_DumpASCII() uses a single write() call if possible (GH-29596) (GH-29598)
If the string is ASCII only and doesn't need to escape characters,
write the whole string with a single write() syscall.
(cherry picked from commit b919d8105c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-11-17 22:59:19 +01:00
Miss Islington (bot)
1079b3e3cb
bpo-42540: reallocation of id_mutex should not force default allocator (GH-29564)
Unlike the other locks reinitialized by _PyRuntimeState_ReInitThreads,
the "interpreters.main->id_mutex" is not freed by _PyRuntimeState_Fini
and should not force the default raw allocator.
(cherry picked from commit 736684b1bb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-17 13:16:01 -08:00
Pablo Galindo Salgado
5618c81e13
[3.10] bpo-45716: Improve the error message when using True/False/None as keywords in a call (GH-29413). (GH-29428)
(cherry picked from commit e2d65630f3)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-16 22:31:16 +00:00
Miss Islington (bot)
7bac598819
Save a reference for ensure_future and create_task (GH-29163)
Co-authored-by: Joannah Nanjekye <jnanjekye@python.org>
(cherry picked from commit c750adbe69)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2021-11-16 03:51:19 -08:00
Anthony Sottile
7c99e434a9
ensure deprecation warning from assertDictContainsSubset points at actual test code (#26497) 2021-11-15 21:11:02 -06:00
Miss Islington (bot)
94dad5e41e
bpo-45677: Reword first section of sqlite3 docs (GH-29326) (GH-29566)
* bpo-45677: Avoid addressing the reader as 'you' in sqlite3 docs

* Adjust wording

* Adjust wording again

* Typo

* Update Doc/library/sqlite3.rst

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>

* Address review: adjust wording

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Apply Alex' suggestion, and apply 80 char limit to PR

* Minor adjustment

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 6c5a312fb6)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-15 15:31:38 -08:00
Miss Islington (bot)
0320cf1a25
bpo-25381: Update explanation of exceptions in C. (GH-26838) (GH-29568)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

(cherry picked from commit ad43dc0b54)
2021-11-15 18:06:45 -05:00
Miss Islington (bot)
55d24edaad
bpo-45752: Remove "array" from list of things that cannot be copied in copy module docstring (GH-29555)
Automerge-Triggered-By: GH:asvetlov
(cherry picked from commit c2c4fdf5ea)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-14 05:18:31 -08:00
M. Mostafa Farzan
2081f9fe75
[3.10] bpo-45752: Fix no-support examples in 'copy' docs (GH-29548) (GH-29556)
(cherry picked from commit b7360ae395)

Co-authored-by: M. Mostafa Farzan <m2_farzan@yahoo.com>

Automerge-Triggered-By: GH:asvetlov
2021-11-14 04:54:42 -08:00
Miss Islington (bot)
bf26a6da7a
bpo-45738: Fix computation of error location for invalid continuation (GH-29550)
characters in the parser
(cherry picked from commit 25835c518a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-13 17:30:03 -08:00
Miss Islington (bot)
28326ac5f8
bpo-45799: [Doc] improve confusing sentence in __main__.rst (GH-29546)
I was reading this bit last night and thought it was a typo. In the light of day, I realized it wasn't *technically* a typo, but definitely confusing wording. This PR fixes the confusing sentence.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit f8da00ef04)

Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
2021-11-13 12:36:44 -08:00
Miss Islington (bot)
ed55426acd
[bpo-45765] Fix distribution discovery on empty path. (GH-29487) (GH-29510)
(cherry picked from commit 6ec0dec7b7)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-11-13 15:08:28 -05:00
Miss Islington (bot)
3f15792d60
[3.10] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29542)
* [bpo-45772](): socket.socket should be a class instead of a function

Currently `socket.socket` is documented as a function, but it is really
a class (and thus has function-like usage to construct an object). This
correction would ensure that Python projects that are interlinking
Python's documentation can properly locate `socket.socket` as a type.
(cherry picked from commit 4c792f39e6)


Co-authored-by: Hong Xu <hong@topbug.net>

Automerge-Triggered-By: GH:asvetlov
2021-11-12 22:23:23 -08:00
Miss Islington (bot)
e4c5a5eaba
bpo-45235: Revert an argparse bugfix that caused a regression (GH-29525) (GH-29530) 2021-11-12 12:44:55 -06:00
Miss Islington (bot)
628667ac9a
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533) (GH-29535)
Since `.. module:: contextvars` sets the module using `.. class:: contextvars.Token`, intersphinx records it as `contextvars.contextvars.Token`.
(cherry picked from commit e501d70b34)

Co-authored-by: Hynek Schlawack <hs@ox.cx>

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-11-12 12:19:52 +02:00
Brandt Bucher
a89bbde83f
[3.10] bpo-45773: Stop "optimizing" certain jump patterns (GH-29526) 2021-11-11 13:52:43 -08:00
Irit Katriel
c5bfb88eb6
[3.10] bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_ARG before a no-arg opcode (GH-29480) (GH-29506) 2021-11-09 22:05:30 +00:00
Miss Islington (bot)
d29f591dd6
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resource files (GH-29501)
(cherry picked from commit a56fbad85e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-11-09 12:43:12 -08:00
Steve Dower
340ecafdf3
bpo-45732: Update bundled Tcl/Tk on Windows to 8.6.12 (GH-29477) 2021-11-09 17:48:49 +00:00
Miss Islington (bot)
2c4792264f
Closes bpo-45712: Add missing word in control flow tutorial (GH-29460)
(cherry picked from commit 7484a5c82a)

Co-authored-by: 180909 <734461790@qq.com>
2021-11-08 09:13:02 -08:00
Miss Islington (bot)
69b3de65ad
bpo-40170: Update What's New in Python 3.9 (GH-29470)
The PyType_HasFeature() change has been reverted: the static inline
function access directly the PyTypeObject.tp_flags member.
(cherry picked from commit 99c7e9853f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-11-08 09:05:15 -08:00
Miss Islington (bot)
77afb76942
bpo-45741: docs: fix plural (GH-29461) (GH-29463)
"entry points provides" -> "entry points provide"

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit 19b107e9b5)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2021-11-08 01:32:23 -05:00
Miss Islington (bot)
045f205ba4
bpo-45392: Update the docstring of the 'type' built-in (GH-29439) (GH-29452)
(cherry picked from commit 9127520729)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-11-06 21:21:04 +01:00
Miss Islington (bot)
8fdf6c64d3
bpo-27313: Use non-deprecated methods for tracing (GH-29425) (GH-29450)
(cherry picked from commit cc1cbcbb2d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-11-06 20:23:00 +01:00
Miss Islington (bot)
e53cb9811f
bpo-39452: [doc] Change "must" to "can" on relative import style in __main__ (GH-29379) (GH-29449)
(cherry picked from commit 57457a1e5c)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2021-11-06 19:50:00 +01:00