Commit graph

114691 commits

Author SHA1 Message Date
Miss Islington (bot)
5dce4ab736
gh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)
These slots are marked "should be treated as read-only" in the
table at the start of the document.  That doesn't say anything about
setting them in the static struct.

`tp_bases` docs did say that it should be ``NULL`` (TIL!). If you
ignore that, seemingly nothing bad happens. However, some slots
may not be inherited, depending on which sub-slot structs are present.
(FWIW, NumPy sets tp_bases and is affected by the quirk -- though to
be fair, its DUAL_INHERIT code probably predates tp_bases docs, and
also the result happens to be benign.)

This patch makes things explicit.
It also makes the summary table legend easier to scan.

(cherry picked from commit 219696abb2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-28 03:25:04 -08:00
Kumar Aditya
6f658dd60d
[3.11] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (GH-18640) (#99841)
Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

(cherry picked from commit 53eef27133)
2022-11-28 16:47:33 +05:30
Miss Islington (bot)
1e327059a3
bpo-41825: restructure docs for the os.wait*() family (GH-22356)
(cherry picked from commit 492dc02b01)

Co-authored-by: Georg Brandl <georg@python.org>
2022-11-28 01:48:52 -08:00
Miss Islington (bot)
fce9516a0f
gh-51524: Fix bug when calling trace.CoverageResults with valid infile (GH-99629)
(cherry picked from commit 594de165bf)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-11-27 23:15:00 -08:00
Miss Islington (bot)
f160996412
Docs: both sqlite3 "point examples" now adapt to str (GH-99823)
(cherry picked from commit 276643e207)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-11-27 13:21:00 -08:00
Miss Islington (bot)
366adc7c83
gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)
GH-91340

https://bugs.python.org/issue47184
(cherry picked from commit dfc2732a57)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
Automerge-Triggered-By: GH:kumaraditya303
2022-11-27 10:05:59 -08:00
Miss Islington (bot)
e4cfdaa45b
GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (GH-99768)
On macOS all file descriptors for a particular file in /dev/fd
share the same file offset, that is ``open("/dev/fd/9", "r")`` behaves
more like ``dup(9)`` than a regular open.

This causes problems when a user tries to run "/dev/fd/9" as a script
because zipimport changes the file offset to try to read a zipfile
directory. Therefore change zipimport to reset the file offset after
trying to read the zipfile directory.
(cherry picked from commit d08fb25769)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-27 03:19:02 -08:00
Miss Islington (bot)
8bb7fdaee8
doc: Remove backslashes in doctest grammar docs (GH-29346)
(cherry picked from commit 22860dbbc8)

Co-authored-by: George Zhang <geetransit@gmail.com>
2022-11-26 22:46:33 -08:00
Miss Islington (bot)
4ce1a827db
bpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (GH-24659)
The docs stated that PyImport_ImportFrozenModuleObject() returns a
new reference, but it actually returns an int.

(cherry picked from commit 62a5dc13e9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-26 22:37:08 -08:00
Miss Islington (bot)
193a25e89c
gh-91078: Return None from TarFile.next when the tarfile is empty (GH-91850)
(cherry picked from commit 78365b8e28)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-26 11:01:20 -08:00
Miss Islington (bot)
fe9957241a
gh-99795: Fix typo in importlib.resources.abc (GH-99796)
Changing TraversableReader to TraversableResources at one place of the documentation.

See GH-99795 for more details.
(cherry picked from commit 5f8898216e)

Co-authored-by: busywhitespace <busywhitespace@tuta.io>
2022-11-26 10:12:23 -08:00
Miss Islington (bot)
45ffab40e8
gh-97966: Restore prior expectation that uname_result._fields and ._asdict would include the processor. (gh-98343)
(cherry picked from commit dc063a25d2)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-11-26 05:53:00 -08:00
Miss Islington (bot)
3e3980b49e
GH-95896: posixmodule.c: fix osdefs.h inclusion to not depend on compiler (GH-95897)
(cherry picked from commit ec2b76aa8b)

Co-authored-by: TheShermanTanker <32636402+TheShermanTanker@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-26 01:57:49 -08:00
Miss Islington (bot)
f98322920e
[3.11] gh-99502: mention bytes-like objects as input in secrets.compare_digest (GH-99512) (#99791)
gh-99502: mention bytes-like objects as input in `secrets.compare_digest` (GH-99512)

Now it is in sync with https://docs.python.org/3/library/hmac.htmlGH-hmac.compare_digest
It is the same function, just re-exported. So, I guess they should mention the same input types.
(cherry picked from commit 47d673d81f)

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

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-26 15:19:23 +05:30
Miss Islington (bot)
0006d9bf7b
Fix typo in __match_args__ doc (GH-99785)
A opy of GH-98549, whose author (@icecream17) uses a school computer that blocks the CLA site. I did not mention this in commit comment above so CLA bot does not pick up the name and request the CLA again.
(cherry picked from commit a86d854522)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-11-25 16:10:48 -08:00
Miss Islington (bot)
00755196e3
[3.11] Fix misspelling in docs for http.HTTPMethod (GH-99376) (#99451)
Fix misspelling in docs for http.HTTPMethod (GH-99376)
(cherry picked from commit f0d12ca0e0)

Co-authored-by: Matt Harasymczuk <github.com@haras.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-25 18:26:50 -05:00
Miss Islington (bot)
f5fa17bef5
gh-64019: Have attribute table in inspect docs link to module attributes instead of listing them (GH-98116)
(cherry picked from commit 7d2dcc53d0)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Michael Anckaert <michael.anckaert@sinax.be>
2022-11-25 14:06:45 -08:00
Miss Islington (bot)
772fc63516
[3.11] gh-85073: Add some missing links to source (GH-99363) (#99586)
gh-85073: Add some missing links to source (GH-99363)

Add some missing links to source from Python docs
(cherry picked from commit 27d8dc2c9d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-25 23:19:40 +05:30
Miss Islington (bot)
c06f74f1d6
bpo-38031: Fix a possible assertion failure in _io.FileIO() (GH-GH-5688)
(cherry picked from commit d386115039)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-11-25 05:20:00 -08:00
Miss Islington (bot)
5b7408490f
gh-96168: Add sqlite3 row factory how-to (GH-99507)
(cherry picked from commit 8749121b07)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-11-25 05:15:09 -08:00
Miss Islington (bot)
d279f38a71
Fix rendering of audioop license in Doc/license.rst (GH-99752)
Also some cosmetic blank line additions for consistency with the
formatting of the rest of the file.
(cherry picked from commit b5b3904f05)

Co-authored-by: Zachary Ware <zach@python.org>
2022-11-24 08:29:21 -08:00
Miss Islington (bot)
4255a9fbc3
gh-98872: Fix a possible resource leak in Python 3.11.0 (GH-99047)
Issue: GH-98872
(cherry picked from commit 4e5f2db6f2)

Co-authored-by: SQLPATCH <95843853+SQLPATCH@users.noreply.github.com>
Automerge-Triggered-By: GH:kumaraditya303
2022-11-24 01:45:40 -08:00
Miss Islington (bot)
d74117acc1
Use faster APIs to calculate paths at startup for Store packaged Python on Windows (GH-99345)
(cherry picked from commit 71a4a2da98)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-23 12:12:34 -08:00
Dong Uk, Kang
24fad64cef
[3.11] gh-88863: Clear ref cycles to resolve leak when asyncio.open_connection raises (GH-95739) (#99721)
Break reference cycles to resolve memory leak, by
removing local exception and future instances from the frame.
(cherry picked from commit 995f6170c7)

Co-authored-by: Dong Uk, Kang <nailbrainz@gmail.com>
2022-11-23 10:37:24 -08:00
Miss Islington (bot)
609273eb52
gh-99619: fix error in documentation of ExceptionGroup.derive() (GH-99621)
(cherry picked from commit 5d9183c7ad)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-23 03:08:22 -08:00
Miss Islington (bot)
59361ecfb0
GH-95283: Add note about compilers in Mac/README.txt (GH-99506)
The build machinery assumes that the compiler that's used
to build on macOS includes an SDK that's at least as new
as the OS version on the build machine. Explicitly mention
this in Mac/README.txt.
(cherry picked from commit 8f024a02d7)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-23 03:03:43 -08:00
Miss Islington (bot)
b4ae5b76ed
[3.11] gh-99650 : Updated argparse docs (GH-99653) (GH-99705) 2022-11-22 14:17:20 -08:00
Miss Islington (bot)
a64e71eece
GH-92892: Add section about variadic functions to ctypes documentation (GH-99529)
On some platforms, and in particular macOS/arm64, the calling
convention for variadic arguments is different from the regular
calling convention. Add a section to the documentation to document
this.
(cherry picked from commit bc3a11d21d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-22 10:57:09 -08:00
Miss Islington (bot)
420b7e8f43
[3.11] gh-99146 struct module documentation should have more predictable examples/warnings (GH-99141) (GH-99702)
gh-99146 struct module documentation should have more predictable examples/warnings (GH-99141)

* nail down a couple examples to have more predictable output

* update a number of things, but this is really just a stash...

* added an applications section to describe typical uses for native and machine-independent formats

* make sure all format strings use a format prefix character

* responding to comments from @gpshead. Not likely finished yet.

* This got more involved than I expected...

* respond to several PR comments
* a lot of wordsmithing
* try and be more consistent in use of ``x`` vs ``'x'``
* expand examples a bit
* update the "see also" to be more up-to-date
* original examples relied on import * so present all examples as if

* reformat based on @gpshead comment (missed before)

* responding to comments

* missed this

* one more suggested edit

* wordsmithing
(cherry picked from commit 22d91c16bb)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-11-22 18:16:59 +00:00
Serhiy Storchaka
9a7899b279
[3.11] gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646) (GH-99698)
Now addClassCleanup() uses separate lists for different TestCase subclasses,
and doClassCleanups() only cleans up the particular class.

(cherry picked from commit c2102136be)
2022-11-22 19:02:56 +02:00
Miss Islington (bot)
9a4b2f4f7f
gh-93937: Document PyFrame_Check and PyFrame_Type (GH-99695)
(cherry picked from commit d15b9f19ac)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-11-22 07:50:39 -08:00
Serhiy Storchaka
49f2eee0a3
[3.11] gh-99016: Make build scripts compatible with Python 3.8 (GH-99017). (GH-99693)
(cherry picked from commit f520d720f6)
2022-11-22 17:46:18 +02:00
Miss Islington (bot)
f38eebb88b
GH-97001: Release GIL in termios extension (GH-99503)
Without releasing the GIL calls to termios APIs might block the entire interpreter.
(cherry picked from commit 959ba45d75)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-22 03:28:06 -08:00
Miss Islington (bot)
85dbd2d767
gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)
(cherry picked from commit 1acdfec359)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-11-22 03:03:26 -08:00
Miss Islington (bot)
e26aa24b47
gh-99659: Use correct exceptions in sqlite3 bigmem tests (GH-99660)
The tests in question were added in 0eec6276fd by Serhiy. Apparently,
sqlite3 changed exceptions raised in those cases in the mean time but
the tests never ran because they require a high `-M` setting in the
test runner.
(cherry picked from commit 2781ec9b0e)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-11-22 00:51:59 -08:00
Miss Islington (bot)
05147dc383
gh-99662: fix typo in typing.TypeVarTuple docs (GH-99672)
(cherry picked from commit 1bf983ce7e)

Co-authored-by: GabrielAnguita <60579349+GabrielAnguita@users.noreply.github.com>
2022-11-21 20:09:49 -08:00
Batuhan Taskaya
a3480ec795
[3.11] gh-99103: Normalize specialized traceback anchors against the current line (#99423)
[3.11] gh-99103: Normalize specialized traceback anchors against the current line (GH-99145)

Automerge-Triggered-By: GH:isidentical.
(cherry picked from commit 57be545959)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-11-21 22:16:12 +00:00
Miss Islington (bot)
2d5f4ba174
gh-98629: Fixes sys._git and sys.version creation on Windows (GH-99664)
(cherry picked from commit 49e554dbaf)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-21 13:13:52 -08:00
Victor Stinner
0c6b3a2d8e
[3.11] Revert "[3.11] gh-98724: Fix Py_CLEAR() macro side effects (#99100)" (#99573)
Revert "gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#99288)"

This reverts commit 1082890857.
2022-11-21 18:01:10 +01:00
Miss Islington (bot)
555e76e907
Add more details in test_unittest (GH-99626)
(cherry picked from commit 653e563d80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-21 04:23:09 -08:00
Miss Islington (bot)
9dda9020ab
gh-99578: Fix refleak in _imp.create_builtin() (GH-99642)
Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".
(cherry picked from commit cb2ef8b2ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-11-21 03:43:23 -08:00
Miss Islington (bot)
bb4c091583
[3.11] GH-95815: Document less specific error for os.remove (GH-99571) (#99641)
GH-95815: Document less specific error for os.remove (GH-99571)

os.remove can raise PermissionError instead of IsADirectoryError,
when the object to be removed is a directory (in particular on
macOS).

This reverts a change done in GH-14262.
(cherry picked from commit 1cae31d26b)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-21 12:04:55 +01:00
Miss Islington (bot)
aa067868ec
[3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638)
gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470)

Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
(cherry picked from commit cdde29dde9)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-21 11:22:10 +01:00
Miss Islington (bot)
f381644819
gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (GH-99605)
(cherry picked from commit e13d1d9dda)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-11-20 12:53:02 -08:00
Lysandros Nikolaou
152a437b8d
[3.11] gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215) (GH-99622)
gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)

(cherry picked from commit 9c4232ae89)
2022-11-20 19:29:05 +01:00
Serhiy Storchaka
56a517e9e8
[3.11] gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431). (GH-99614)
(cherry picked from commit 06d4e02c3b)
2022-11-20 11:24:45 +02:00
Miss Islington (bot)
a15ab1ec65
Doc: Make functions.html readable again. (GH-99476)
(cherry picked from commit 858cb79486)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-11-19 02:58:32 -08:00
Miss Islington (bot)
7e742379af
[3.11] gh-98086: Now `patch.dict` can decorate async functions (GH-98095) (#99365)
gh-98086: Now ``patch.dict`` can decorate async functions (GH-98095)
(cherry picked from commit 67b4d2772c)

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

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-19 10:10:42 +00:00
Miss Islington (bot)
369cb3e66a
Doc: Replace question mark with fullstop (GH-99558)
The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period
instead of a question mark.
(cherry picked from commit 0e09d2cc59)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2022-11-18 11:34:10 -08:00
Miss Islington (bot)
d5e6f9b0ab
gh-99442: Fix handling in py.exe launcher when argv[0] does not include a file extension (GH-99542)
(cherry picked from commit a220c6d1ee)
2022-11-18 17:49:14 +00:00