Commit graph

25040 commits

Author SHA1 Message Date
Miss Islington (bot)
5252ad2b64
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:45 -08:00
Miss Islington (bot)
fa6cc9e6df
[3.10] gh-99146 struct module documentation should have more predictable examples/warnings (GH-99141) (GH-99703)
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:17:18 +00:00
Miss Islington (bot)
101dfaedb2
[3.10] GH-95815: Document less specific error for os.remove (GH-99571) (#99639)
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>
2022-11-21 12:05:32 +01:00
Stanley
4572c98ad2
[3.10] gh-85073: Add some missing links to source (GH-99363) (#99589)
(cherry picked from commit 27d8dc2c9d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-19 06:44:52 -08:00
Miss Islington (bot)
731a747a91
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:17 -08:00
Kamil Turek
bc2cdfc815
[3.10] gh-92119: ctypes: Print exception class name instead of its representation (GH-98302) (#99452)
gh-92119: ctypes: Print exception class name instead of its representation (#98302)

(cherry picked from commit b9dedfe61d)
2022-11-13 15:55:58 -08:00
Miss Islington (bot)
5324893599
gh-99392: Fix sqlite3 converter recipes (GH-99393)
(cherry picked from commit dfc1b17a23)

Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2022-11-12 11:47:59 -08:00
Miss Islington (bot)
ad5159b7de
gh-87604: Clarify in docs that sys.addaudithook is not for sandboxes (GH-99372)
(cherry picked from commit c3c3871415)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-11 05:41:41 -08:00
Miss Islington (bot)
5612471501
gh-98366: use sphinx.locale._ as gettext() in pyspecific.py (GH-98437)
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a0a5)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
2022-11-10 17:32:30 -08:00
Miss Islington (bot)
f7d3b18ed5
GH-99183: Document behavior of count() for empty substrings (GH-99339)
(cherry picked from commit 2f4af2d99c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2022-11-10 13:27:42 -08:00
Miss Islington (bot)
bec131759e
gh-99238: clarify the type of the env dict. (GH-99253)
(cherry picked from commit 2eee9d9cd7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-08 13:08:08 -08:00
Miss Islington (bot)
b51c2832f0
Fix broken link in asyncio-subprocesses doc (GH-99214)
GH- Fix broken link in Doc/library/asyncio-subprocess.rst

This is a trivial fix in documentation to fix a broken link.

There is a broken link in [Doc/library/asyncio-subprocess.rst](https://docs.python.org/3/library/asyncio-subprocess.htmlGH-asyncio.subprocess.Process) for the function ``wait_for``:

![image](https://user-images.githubusercontent.com/37690409/200388894-fb6b7c42-b2cc-49ec-a239-e3472890db1f.png)

I suppose this refers to the function ``asyncio.wait_for`` which is not clear in the docs.

This PR fixes the link and the result looks like the following:

![image](https://user-images.githubusercontent.com/37690409/200389483-b4a92105-7d2c-4285-b0fc-78a6dc0be39c.png)
(cherry picked from commit acf4d5d5bd)

Co-authored-by: Mikael Koli <koli.mikael@gmail.com>
Automerge-Triggered-By: GH:AlexWaygood
2022-11-08 08:33:28 -08:00
Miss Islington (bot)
d2cb0f9117
[3.10] gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002) (GH-99213)
gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002)

The flag is not inherited, but its effect -- a NULL tp_new -- is.

Drop hints for people who come here wanting to “disallow instantiation”.
(cherry picked from commit 1438b77997)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-11-07 19:56:21 +01:00
Miss Islington (bot)
6b46cb4d33
doc: Formatting and typo fixes (GH-98974)
(cherry picked from commit 728e42fcf5)

Co-authored-by: jmcb <joelsgp@protonmail.com>
2022-11-07 09:14:28 -08:00
Miss Islington (bot)
8eb4e2ce3f
gh-94286 Fix documentation of print default param (GH-94297)
(cherry picked from commit 2db55e0c00)

Co-authored-by: Nouran Ali <nouranalimohammed@gmail.com>
2022-11-06 12:23:01 -08:00
Miss Islington (bot)
0f45b2edac
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:47 -07:00
Miss Islington (bot)
3a7e9ea090
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:31:33 -07:00
Serhiy Storchaka
22bbb0c4c7
[3.10] gh-98740: Fix validation of conditional expressions in RE (GH-98764) (GH-99046)
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 12:18:50 +02:00
Miss Islington (bot)
b9e621b9f4
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:15 -07:00
Miss Islington (bot)
8c0cf111a0
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:23:22 -07:00
Miss Islington (bot)
f9b37d4d26
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:16:33 -07:00
Stanley
c592b33977
[3.10] gh-96265: Formatting changes for faq/programming (GH-98242) (#98994)
* 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

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit 0689b99bb8)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-03 01:30:12 +01:00
Miss Islington (bot)
6cf30c6cc4
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:56:14 -07:00
Jelle Zijlstra
e07086db03
[3.10] gh-92871: Postpone the removal of typing.{io,re} to 3.13 (GH-98958) (#98986)
[3.10] 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>

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-11-02 09:12:37 +00:00
Miss Islington (bot)
5f0d266af9
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:05:28 -07:00
Miss Islington (bot)
8a7695e2b7
[3.10] [doc] Update cookbook example for socket-based logging in a production sett… (GH-98922) (GH-98981)
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:48 +00:00
Miss Islington (bot)
8648c06b9b
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:26 -07:00
Miss Islington (bot)
1907e5a7cc
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:08:54 -07:00
Miss Islington (bot)
23545fb277
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:52:05 -07:00
Miss Islington (bot)
c76e70a409
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:53:54 -07:00
Miss Islington (bot)
85f88f63d9
Fix typo in contextvars docs (GH-98823)
(cherry picked from commit 72fa57a8fe)

Co-authored-by: cburroughs <chris.burroughs@gmail.com>
2022-10-28 14:19:43 -07:00
Alex Waygood
4320115613
[3.10] argparse docs: normalize constant references (#98765) (#98808)
`argparse` docs: normalize constant references (#98765)

(cherry picked from commit b27b57c6e4)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-10-28 18:17:03 +01:00
Miss Islington (bot)
586bb1fd8b
[3.10] bpo-2716: add license for audioop module (GH-19972) (#98532)
bpo-2716: add license for audioop module (GH-19972)
(cherry picked from commit 4c1145bb37)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2022-10-28 12:11:26 +02:00
Stanley
f786485f13
[3.10] Change links to label refs (GH-98454) (#98726)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-26 13:19:39 -07:00
Erlend E. Aasland
4b41b11a63
[3.10] gh-98716: Revert gh-96081: Escape lone stars in sqlite3 docs (GH-98720) (#98737)
(cherry picked from commit 365852a03a)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-10-26 22:19:20 +02:00
Miss Islington (bot)
5e08585317
gh-98348: Mention ReferenceError in weakref.proxy documentation (GH-98355)
(cherry picked from commit 216f45e4fe)

Co-authored-by: fancidev <fancidev@gmail.com>
2022-10-25 20:55:29 -07:00
Miss Islington (bot)
0f93725063
gh-77753: Add example for values that compare equal in stdtypes (GH-98497)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 0ca6a4d640)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-25 20:01:11 -07:00
Miss Islington (bot)
866dc74afa
gh-84747: Add async for comment for StreamReader (GH-98633)
(cherry picked from commit 4196ee5c8b)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-25 19:23:08 -07:00
Miss Islington (bot)
3e335f2c0d
gh-98623: Fix base classes in typing.rst (GH-98626)
(cherry picked from commit 5076108872)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-25 07:15:07 -07:00
Miss Islington (bot)
d79a42aac8
gh-98507: [typing docs] Rephrase "now supports []" to "now supports subscripting" (GH-98508)
(cherry picked from commit e3b9dd8e87)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-24 11:17:33 -07:00
Miss Islington (bot)
39e914c03a
GH-91635: clarify docs about closing of transport in asyncio (GH-98563)
(cherry picked from commit 2fdcc6f2cb)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-24 11:01:37 -07:00
Miss Islington (bot)
e69509f468
gh-98500: Fix typing docs for *View classes (GH-98511)
(cherry picked from commit 1a217f9ffc)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-24 10:54:35 -07:00
Miss Islington (bot)
f3c23fc48c
gh-98561: Fix a typo in typing (GH-98562)
(cherry picked from commit b6d5d5b60a)

Co-authored-by: Omkaar <79257339+Infiniticity@users.noreply.github.com>
2022-10-23 07:11:29 -07:00
Miss Islington (bot)
dcb342b5f9
gh-51511: Note that codecs.open()'s encoding parameter affects automatic conversion to binary mode (GH-94370)
(cherry picked from commit d9407b174c)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-21 16:28:25 -07:00
Miss Islington (bot)
3f040bc8e4
[3.10] [doc] Improve logging cookbook example. (GH-98481) (GH-98482)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2022-10-20 12:53:53 +01:00
Vinay Sajip
dddbbd9e3e
[3.10] [doc] Refresh the venv introduction documentation, and correct… (GH-98466)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Phil Elson <pelson.pub@gmail.com>
2022-10-19 22:56:26 +01:00
Miss Islington (bot)
ac2e7bec08
Doc: Remove title text from internal links (GH-98409)
Rely on the title of the linked internal page instead of putting the title. Sphinx will render with the title correctly, and this will reduce work for translators
(cherry picked from commit 52fcba6512)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2022-10-19 08:45:25 -07:00
C.A.M. Gerlach
b2db1c2080
[3.10] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98373)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>.
(cherry picked from commit fa2d43e518)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-10-18 01:49:47 +02:00
Miss Islington (bot)
26307384ff
gh-85299: Add note warning about entry point guard for asyncio example (GH-93457)
(cherry picked from commit 79fd6ccdbe)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-16 10:13:28 -07:00
Jelle Zijlstra
8a1f1cbe1a
[3.10] docs(typing): harmonize "See PEP x for more details" (GH-97927). (#98293)
(cherry picked from commit 02389658a4)

Co-authored-by: Simon Legner <Simon.Legner@gmail.com>
2022-10-15 21:08:46 -07:00