Commit graph

114588 commits

Author SHA1 Message Date
Miss Islington (bot)
be4bab8c2b
gh-93464: [Enum] fix auto() failure during multiple assignment (GH-99148)
* fix auto() failure during multiple assignment

i.e. `ONE = auto(), 'text'` will now have `ONE' with the value of `(1,
'text')`.  Before it would have been `(<an auto instance>, 'text')`
(cherry picked from commit 8feb7ab77c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-11-06 06:30:32 -08:00
Miss Islington (bot)
29c3dc050a
gh-83004: Clean up refleak in _io initialisation (GH-98840)
(cherry picked from commit 1208037246)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-06 06:03:52 -08:00
Miss Islington (bot)
d025046ef5
test_typing: use all pickle protocols (GH-99154)
(cherry picked from commit a0bc75e2fd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-06 04:15:45 -08:00
Miss Islington (bot)
e0fc2b3fd1
[doc] fix typo (GH-99143)
(cherry picked from commit 586b07e1f9)

Co-authored-by: Doj <34577424+visualdoj@users.noreply.github.com>
2022-11-05 14:12:22 -07:00
Miss Islington (bot)
0a99a79afe
gh-99134: Update bundled pip to 22.3.1 (gh-99135)
Update bundled pip to 22.3.1
(cherry picked from commit 47ab8480e7)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2022-11-05 12:27:23 -07:00
Miss Islington (bot)
d8c11b75e2
gh-94808: add tests covering PySequence_{Set,Del}Slice (GH-99123)
(cherry picked from commit c5c40773cb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-05 10:32:46 -07:00
Jason R. Coombs
07734a42db
[3.11] gh-98706: Sync with importlib_metadata 4.13.0. (GH-98875)
These changes are already applied to main but have been selected from importlib_metadata 4.x for their bug fixes.
2022-11-05 06:55:04 -07:00
Miss Islington (bot)
46a493e2db
gh-94808: add tests covering PyEval_GetFuncDesc function (GH-98300)
(cherry picked from commit b5f711185b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-05 06:32:46 -07:00
Erlend E. Aasland
573b451886
[3.11] gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM (GH-99085) (#99118)
(cherry picked from commit 12078e78f6)

Co-authored-by: Sam James <sam@cmpct.info>
2022-11-05 10:27:47 +01:00
Victor Stinner
a9a8c87126
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (#99071) (#99098)
The test.support.wait_process() function now uses a timeout of
LONG_TIMEOUT seconds by default, instead of SHORT_TIMEOUT.  It
doesn't matter if a Python buildbot is slower, it only matters that
the process completes. The timeout should just be shorter than
"forever".

(cherry picked from commit f09da28768)
2022-11-04 15:50:51 +01:00
Miss Islington (bot)
f7d2c948f5
minor edits to locale doc (GH-98537)
(cherry picked from commit c0bf7607a1)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-11-04 06:12:01 -07:00
Miss Islington (bot)
2b79f4e469
[3.11] gh-94808: Cover LOAD_GLOBAL for custom dict subtypes (GH-96767) (GH-99091) 2022-11-04 11:12:42 +00:00
Miss Islington (bot)
2ef2eaac15
Docs: add named to the list of styles in the sqlite3.paramstyle attr docs (GH-99078)
(cherry picked from commit 016c7d37b6)

Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-11-03 16:27:53 -07:00
Miss Islington (bot)
41a9f49bc5
gh-98978: Fix Py_SetPythonHome(NULL) (GH-99066)
Fix use-after-free in Py_SetPythonHome(NULL), Py_SetProgramName(NULL)
and _Py_SetProgramFullPath(NULL) function calls.

Issue reported by Benedikt Reinartz.
(cherry picked from commit b07f546ea3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-11-03 11:09:15 -07:00
Miss Islington (bot)
eb023a84d9
gh-98740: Fix validation of conditional expressions in RE (GH-98764)
In very rare circumstances the JUMP opcode could be confused with the
argument of the opcode in the "then" part which doesn't end with the
JUMP opcode. This led to incorrect detection of the final JUMP opcode
and incorrect calculation of the size of the subexpression.

NOTE: Changed return value of functions _validate_inner() and
_validate_charset() in Modules/_sre/sre.c.  Now they return 0 on success,
-1 on failure, and 1 if the last op is JUMP (which usually is a failure).
Previously they returned 1 on success and 0 on failure.
(cherry picked from commit e9ac890c02)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-03 00:47:39 -07:00
Miss Islington (bot)
a02979fa48
gh-98512: Add more tests for ValuesView (GH-98515)
(cherry picked from commit 29e027c3e6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-02 19:35:39 -07:00
Miss Islington (bot)
2199a7dace
gh-65002: Make note that null bytes are used to pad bytes (GH-98635)
(cherry picked from commit 8cd21c2c5d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-02 19:24:24 -07:00
Miss Islington (bot)
e0df94dc7c
Docs: Add 'as, match statement' to the index (GH-99001)
(cherry picked from commit 26720fffd0)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-11-02 19:22:41 -07:00
Miss Islington (bot)
8b4d5b1047
argparse howto: Use f-string in preference to "...".format() (GH-98883)
(cherry picked from commit 1fd20d0b57)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-11-02 19:17:33 -07:00
Miss Islington (bot)
88736db5d6
gh-96997: Clarify the contract of PyMem_SetAllocator() (GH-98977)
(cherry picked from commit c053284e39)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-11-02 14:57:26 -07:00
Steve Dower
3ff659aea2
gh-98790: When DLLs directory is missing on Windows, assume executable_dir contains PYD files instead (GH-98936) 2022-11-02 20:04:06 +00:00
Miss Islington (bot)
dc4bf6b229
gh-97731: Specify the full path to the docs for make docclean (GH-98982)
Specify the full path to the docs for `make docclean`
This is to have `make clean` not error out on cross-builds.
(cherry picked from commit 22bab74c8f)

Co-authored-by: Brett Cannon <brett@python.org>
2022-11-02 12:58:48 -07:00
Miss Islington (bot)
04ab357431
gh-98415: Fix uuid.getnode() ifconfig implementation (GH-98423)
The uuid.getnode() function has multiple implementations, tested sequentially.
The ifconfig implementation was incorrect and always failed: fix it.

In practice, functions of libuuid library are preferred, if available:
uuid_generate_time_safe(), uuid_create() or uuid_generate_time().

(cherry picked from commit e3ec272f57)

Co-authored-by: Chaim Sanders <csanders-git@users.noreply.github.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2022-11-02 12:12:31 -07:00
Miss Islington (bot)
46ccb35a40
gh-92679: Clarify asyncio.loop.start_tls parameters (GH-92682)
(cherry picked from commit 898d0d9ad8)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-11-01 22:12:52 -07:00
Miss Islington (bot)
d683bcc7d0
gh-96265: Formatting changes for faq/programming (GH-98242)
* Formatting changes for faq/programming

* Add missing method formatting, use non-literal formatting

* Fix sphinx warnings

* Some extra formatting missed earlier

* More formatting suggestions from review

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

* Add missing colon, avoid referening external module

(cherry picked from commit 0689b99bb8)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-01 22:06:26 -07:00
Miss Islington (bot)
b2e28c8700
gh-92871: Postpone the removal of typing.{io,re} to 3.13 (GH-98958)
(cherry picked from commit 65d1407737)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-11-01 21:00:13 -07:00
Miss Islington (bot)
67f63b82b8
[3.11] [doc] Update cookbook example for socket-based logging in a production sett… (GH-98922) (GH-98980)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-01 23:34:32 +00:00
Miss Islington (bot)
39e0627b77
[3.11] gh-98925: Lower marshal recursion depth for WASI (GH-98938) (GH-98979)
* gh-98925: Lower marshal recursion depth for WASI (GH-98938)

For wasmtime 2.0, the stack depth cost is 6% higher. This causes the default max `marshal` recursion depth to blow the stack.

As the default marshal depth is 2000 and Windows is set to 1000, split the difference and choose 1500 for WASI to be safe.
(cherry picked from commit 9711265182)

Co-authored-by: Brett Cannon <brett@python.org>
2022-11-01 16:18:55 -07:00
Miss Islington (bot)
cd6655a858
gh-98689: Update Windows builds to zlib v1.2.13 (GH-98968)
(cherry picked from commit c0859743d9)

Co-authored-by: Zachary Ware <zach@python.org>
2022-11-01 11:30:54 -07:00
Miss Islington (bot)
129de5d4a2
Doc: use "unnumbered" footnotes (GH-98954)
Use unnumbered footnote in this file to avoid reseting the footnotes numbering.

Example: when building the tutorial into a PDF and using `latex_show_urls = "footnotes"`; this footnote become the number 8. However, without this change, the footnote shows the number 1.
(cherry picked from commit f042646595)

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2022-11-01 06:35:34 -07:00
Miss Islington (bot)
e02ce485ac
[3.11] Missing PS1 prompt in tutorial example (GH-98921) (GH-98944)
(cherry picked from commit d22bde983e)


Co-authored-by: Manuel Kaufmann <humitos@gmail.com>

Automerge-Triggered-By: GH:rhettinger
2022-11-01 04:08:26 -07:00
Miss Islington (bot)
20c258c692
gh-98852: Fix subscription of type aliases (GH-98920)
Fix subscription of type aliases containing bare generic types or types
like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int],
where A is a generic type, and T is a type variable.
(cherry picked from commit 0e15c31c7e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-01 01:01:28 -07:00
Miss Islington (bot)
217a317425
Fix wording in Functional Programming HOWTO (GH-98939)
(cherry picked from commit f4d56292e9)

Co-authored-by: partev <petrosyan@gmail.com>
2022-10-31 19:57:42 -07:00
Miss Islington (bot)
8495af8963
GH-98897: fix memory leak if math.dist raises exception (GH-98898)
(cherry picked from commit ab57505070)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-31 19:40:30 -07:00
Miss Islington (bot)
46a3cf4fe3
gh-98692: Enable treating shebang lines as executables in py.exe launcher (GH-98732)
(cherry picked from commit 88297e2a8a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-31 14:31:26 -07:00
Charlie Zhao
2b0cbb90c3
[3.11] gh-98793: Fix typecheck in overlapped.c (GH-98835) (#98889)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 3ac8c0ab6e)
2022-10-31 11:21:01 -07:00
Miss Islington (bot)
a4f8db19ad
Fix typo in sorting HOWTO (GH-98888)
(cherry picked from commit 3b86538661)

Co-authored-by: partev <petrosyan@gmail.com>
2022-10-31 11:07:14 -07:00
Miss Islington (bot)
43cbb3df9a
Doc: Fix sphinx-lint issues (GH-98911)
They were introduced right between GH-98441 and GH-98408.
(cherry picked from commit c1c3be0f9d)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-10-31 10:29:30 -07:00
Miss Islington (bot)
f6f07b252f
gh-98576: Fix types in dataclass.InitVar example (gh-98577)
(cherry picked from commit 880bafc574)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-10-31 08:14:04 -07:00
Miss Islington (bot)
ca24e496ba
[3.11] gh-96151: Use a private name for passing builtins to dataclass. This now allows for a field named BUILTIN (gh-98143) (gh-98900)
gh-96151: Use a private name for passing builtins to dataclass. This now allows for a field named BUILTIN (gh-98143)
(cherry picked from commit 29f98b46b7)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-10-31 10:59:00 -04:00
Miss Islington (bot)
57dd11038f
[3.11] gh-96853: Restore test coverage for Py_Initialize(Ex) (GH-98874)
* As most of `test_embed` now uses `Py_InitializeFromConfig`, add
  a specific test case to cover `Py_Initialize` (and `Py_InitializeEx`)
* Rename `_testembed` init helper to clarify the API used
* Add a `PyConfig_Clear` call in `Py_InitializeEx` to make
  the code more obviously correct (it already didn't leak as
  none of the dynamically allocated config fields were being
  populated, but it's clearer if the wrappers follow the
  documented API usage guidelines)
(cherry picked from commit 05e48865be)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2022-10-31 09:15:12 +10:00
Dennis Sweeney
5efe2eead3
[3.11] gh-98783: Fix crashes when str subclasses are used in _PyUnicode_Equal (GH-98806) (#98871)
* gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` (GH-98806)
(cherry picked from commit 76f989dc3e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-30 14:30:08 -04:00
Miss Islington (bot)
a55bd6f884
glossary.rst: Fix typo in package definition (GH-98865)
This is a tiny typo fix of package definition in glossary.
According to https://devguide.python.org/documentation/help-documenting/ simple typos don’t require issues of their own, but, instead, a pull request can by submitted directly.

Automerge-Triggered-By: GH:AlexWaygood
(cherry picked from commit fc94d55ff4)

Co-authored-by: ab <abousselmi@users.noreply.github.com>
2022-10-29 15:50:31 -07:00
Miss Islington (bot)
d038307b10
Fix typo in docs (GH-98863)
(cherry picked from commit bfecff5f73)

Co-authored-by: Yuvi Panda <yuvipanda@gmail.com>
2022-10-29 13:56:27 -07:00
Miss Islington (bot)
f8fb0d8e77
gh-93358: Fix python-config docs for how to embed Python (GH-98649)
(cherry picked from commit e063c23c65)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-10-29 11:55:01 -07:00
Miss Islington (bot)
e237bf6862
dataclasses docs: consistent indentation (4 spaces) in examples (GH-98855)
(cherry picked from commit d10c2b9742)

Co-authored-by: FC Stegerman <flx@obfusk.net>
2022-10-29 10:15:16 -07:00
Batuhan Taskaya
751da28feb
[3.11] gh-98744: Prevent column-level decoding crashes on traceback module (#98850)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-10-29 15:12:15 +01:00
Miss Islington (bot)
12957d7cbd
Fix typo in contextvars docs (GH-98823)
(cherry picked from commit 72fa57a8fe)

Co-authored-by: cburroughs <chris.burroughs@gmail.com>
2022-10-28 14:23:26 -07:00
Miss Islington (bot)
2d4b6e00f0
argparse docs: normalize constant references (GH-98765)
(cherry picked from commit b27b57c6e4)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-10-28 05:25:58 -07:00
Miss Islington (bot)
725efe4219
[3.11] gh-98624 Add mutex to unittest.mock.NonCallableMock (GH-98688) (#98797)
(cherry picked from commit 0346eddbe9)

Co-authored-by: noah-weingarden <33741795+noah-weingarden@users.noreply.github.com>
2022-10-28 12:17:19 +02:00