Commit graph

28300 commits

Author SHA1 Message Date
Kirill Podoprigora 1a84bdc237
gh-121163: Add "all" as an valid alias for "always" in warnings.simplefilter() (#121164)
Add support for ``all`` as an valid alias for ``always`` in ``warnings.simplefilter()``
and ``warnings.filterswarnings()``.
2024-06-30 19:48:00 +02:00
Vinay Sajip 2a455bbe8f
[doc] Update element positions and styles in logging flow diagram. (GH-121182)
Update element positions and styles.
2024-06-30 14:38:49 +01:00
Russell Keith-Magee 48cd104b0c
gh-120522: Add a --with-app-store-compliance configure option to patch out problematic code (#120984)
* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

* Regenerate configure script.

* Silence the patch echo output.

---------

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-06-30 08:34:35 +08:00
Barney Gale 6b280a8498
GH-119054: Add alt text to pathlib inheritance diagram (#121158)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-29 17:46:53 +00:00
Barney Gale d6d8707ff2
GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (#120970)
Add dedicated subsection for `home()`, `expanduser()`, `cwd()`,
`absolute()`, `resolve()` and `readlink()`. The position of this section
keeps all the `Path` constructors (`Path()`, `Path.from_uri()`,
`Path.home()` and `Path.cwd()`) near the top. Within the section, closely
related methods are kept adjacent. Specifically:

-.`home()` and `expanduser()` (the former calls the latter)
- `cwd()` and `absolute()` (the former calls the latter)
- `absolute()` and `resolve()` (both make paths absolute)
- `resolve()` and `readlink()` (both read symlink targets)
- Ditto `cwd()` and `absolute()`
- Ditto `absolute()` and `resolve()`

The "Other methods" section is removed.
2024-06-29 16:09:47 +01:00
Wim Jeantine-Glenn 0a1e8ff9c1
gh-121101: Document -Wall option (an alias for -Walways) (#121102) 2024-06-29 12:10:13 +05:30
Steve Dower 2894aa14f2
gh-121115: Skip __index__ in PyLong_AsNativeBytes by default (GH-121118) 2024-06-28 16:26:21 +01:00
Kumar Aditya 58a3580836
gh-107803: add whatsnew for asyncio double linked list implementation (#120995) 2024-06-28 14:33:31 +05:30
Alexander Bessman 237baf4d7a
gh-121035: Update logging flow chart to include the lastResort handler. (GH-121036) 2024-06-27 22:11:40 +01:00
Kerim Kabirov 0890ad7c02
gh-115986 Improve pprint docs formatting (GH-117401)
* Move pprinter parameters description to the table

The change improves readability.
Suggested in the GH#116085 PR discussion.

* Make pprint doc with params markup

* Fix formatting
Indentation of code blocks made them nested
"Version changed" is better placed after the code block

* Fix formatting for tests

* fix code indentation for autotests

* Fix identation for autotests

* Remove duplication of the parameters' description

* Rearrange parameters description in a correct order

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-27 16:32:50 +02:00
Serhiy Storchaka db96edd6d1
gh-121027: Add a future warning in functools.partial.__get__ (#121086) 2024-06-27 11:47:20 +00:00
chaen 1c13b29d54
gh-120937: Reference weakref from the __del__ documentation (#120940)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-26 23:07:09 +03:00
Hugo van Kemenade ead676516d
Doc/README: Document 'make htmllive' (#120692)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-06-25 12:08:55 +03:00
Bénédikt Tran bb057ea107
gh-120661: improve example for basic type hints (#120934) 2024-06-25 07:59:56 +00:00
Barney Gale e4a97a7fb1
GH-119054: Add "Permissions and ownership" section to pathlib docs. (#120505)
Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-24 19:05:24 +00:00
Sam Gross 375b723d58
gh-120858: PyDict_Next should not lock the dict (#120859)
PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.

The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.
2024-06-24 14:15:15 -04:00
Victor Stinner 2e157851e3
gh-119182: Add PyUnicodeWriter_WriteUCS4() function (#120849) 2024-06-24 17:40:39 +02:00
Christian Clauss 22b8a35d6e
docs: puremagic.what() as replacement for imghdr.what() (#120871) 2024-06-24 15:32:13 +02:00
Pablo Galindo Salgado ac61d58db0
gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-24 14:08:12 +02:00
Alek Kowalczyk fc297b4ba4
gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (#112191)
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-06-24 08:35:02 +00:00
Barney Gale 35e998f560
GH-73991: Add pathlib.Path.copytree() (#120718)
Add `pathlib.Path.copytree()` method, which recursively copies one
directory to another.

This differs from `shutil.copytree()` in the following respects:

1. Our method has a *follow_symlinks* argument, whereas shutil's has a
   *symlinks* argument with an inverted meaning.
2. Our method lacks something like a *copy_function* argument. It always
   uses `Path.copy()` to copy files.
3. Our method lacks something like a *ignore_dangling_symlinks* argument.
   Instead, users can filter out danging symlinks with *ignore*, or
   ignore exceptions with *on_error*
4. Our *ignore* argument is a callable that accepts a single path object,
   whereas shutil's accepts a path and a list of child filenames.
5. We add an *on_error* argument, which is a callable that accepts
   an `OSError` instance. (`Path.walk()` also accepts such a callable).

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-23 22:01:12 +01:00
Hugo van Kemenade bc37ac7b44
Docs makefile/RTD: Use uv if installed (#120711) 2024-06-23 13:23:27 -06:00
Nyakku Shigure 0b918e81c1
Typing docs: normalize some indents in code examples (#120912) 2024-06-23 16:15:12 +00:00
Kumar Aditya 18b6ca9660
GH-120804: add docs for removal for asyncio child watchers (#120895)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-06-23 13:14:12 +00:00
Nice Zombies b6fa8fe86a
gh-120896: Fix typo in version changed note of urllib.parse.urlparse() (#120898) 2024-06-23 18:00:23 +05:30
Sam Gross 8f17d69b7b
gh-119344: Make critical section API public (#119353)
This makes the following macros public as part of the non-limited C-API for
locking a single object or two objects at once.

* `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()`
* `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()`

The supporting functions and structs used by the macros are also exposed for
cases where C macros are not available.
2024-06-21 15:50:18 -04:00
Eric Snow 03fa2df927
gh-120838: Add a Note in the Docs About Expectations for Py_Finalize() (gh-120839) 2024-06-21 13:05:53 -06:00
Nice Zombies 462832041e
gh-119003: Clarify slice assignments (#119935) 2024-06-21 11:30:50 -07:00
Victor Stinner 4123226bbd
gh-119182: Add PyUnicodeWriter_DecodeUTF8Stateful() (#120639)
Add PyUnicodeWriter_WriteWideChar() and
PyUnicodeWriter_DecodeUTF8Stateful() functions.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-21 19:33:15 +02:00
blhsing 83d3d7aace
gh-120773: document introspective attributes of an async generator object in the inspect module (#120778) 2024-06-21 10:55:36 +00:00
Serhiy Storchaka a2f6f7dd26
gh-111259: Document idiomatic RE pattern (?s:.) that matches any character (GH-120745) 2024-06-21 00:03:49 +03:00
Sam Gross 3af7263037
gh-117511: Make PyMutex public in the non-limited API (#117731) 2024-06-20 11:29:08 -04:00
Bénédikt Tran b8a8e04fec
gh-119698: fix symtable.Class.get_methods and document its behaviour correctly (#120151)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-19 20:49:30 -07:00
Nice Zombies ed5ae6c4d7
gh-118820: Zero-valued flag enum has no name (GH-118848)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 13:09:53 -07:00
Kirill Podoprigora 753ef8db97
Regen `Doc/requirements-oldest-sphinx.txt` (#120753) 2024-06-19 19:21:12 +00:00
Danny Yang 58b3f11176
gh-120521: clarify except* documentation to allow tuples (#120523)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-19 18:49:00 +00:00
Mark Shannon 00257c746c
GH-119462: Enforce invariants of type versioning (GH-120731)
* Remove uses of Py_TPFLAGS_VALID_VERSION_TAG
2024-06-19 17:38:45 +01:00
Awbert a86e6255c3
gh-119960: Add information about regex flags in re module functions (#119978) 2024-06-19 09:42:01 +00:00
Petr Viktorin 45d5cab533
Add a link to free-threading HOWTO to the index (follow-up to GH-119366) (GH-120703) 2024-06-19 09:17:26 +02:00
Barney Gale 20d5b84f57
GH-73991: Add follow_symlinks argument to pathlib.Path.copy() (#120519)
Add support for not following symlinks in `pathlib.Path.copy()`.

On Windows we add the `COPY_FILE_COPY_SYMLINK` flag is following symlinks is disabled. If the source is symlink to a directory, this call will fail with `ERROR_ACCESS_DENIED`. In this case we add `COPY_FILE_DIRECTORY` to the flags and retry. This can fail on old Windowses, which we note in the docs.

No news as `copy()` was only just added.
2024-06-19 00:59:54 +00:00
Donghee Na 7e189aed64
gh-120496: Add a note about iterator thread-safe (gh-120685) 2024-06-18 15:37:34 +00:00
Victor Stinner 16f8e22e7c
gh-120600: Make Py_TYPE() opaque in limited C API 3.14 (#120601)
In the limited C API 3.14 and newer, Py_TYPE() is now implemented as
an opaque function call to hide implementation details.
2024-06-18 14:28:48 +00:00
Sam Gross e8752d7b80
gh-118789: Add PyUnstable_Object_ClearWeakRefsNoCallbacks (#118807)
This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.

Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use `_PyWeakref_ClearRef` on each weakref, but
that's not thread-safe in the free-threaded build.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-18 09:57:23 -04:00
Sam Gross 02b272b702
gh-119241: Add HOWTO for free-threaded C API extensions (#119877)
Some sections adapted from https://github.com/Quansight-Labs/free-threaded-compatibility/
written by Nathan Goldbaum.

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2024-06-18 09:49:51 -04:00
Jan Kaliszewski dacc5ac71a
gh-120381: Fix inspect.ismethoddescriptor() (#120383)
The `inspect.ismethoddescriptor()` function did not check for the lack of
`__delete__()` and, consequently, erroneously returned True when applied
to *data* descriptors with only `__get__()` and `__delete__()` defined.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-18 12:19:43 +00:00
Bénédikt Tran 4bc27abdbe
gh-120662: Improve smtplib example (#120668)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-18 13:56:58 +02:00
Mark Shannon 9cefcc0ee7
GH-120507: Lower the BEFORE_WITH and BEFORE_ASYNC_WITH instructions. (#120640)
* Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions.

* Add LOAD_SPECIAL instruction

* Reimplement `with` and `async with` statements using LOAD_SPECIAL
2024-06-18 12:17:46 +01:00
Saul Pwanson 0506f75c53
fix enum doc typo (#120091) 2024-06-17 21:31:15 +05:30
Victor Stinner 5c4235cd8c
gh-119182: Add PyUnicodeWriter C API (#119184) 2024-06-17 17:10:52 +02:00
Carol Willing a26d27e7ee
Update the documentation howto index page and group docs into 3 logical sections (GH-119366)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-06-17 16:37:33 +02:00