Commit Graph

13154 Commits

Author SHA1 Message Date
Nice Zombies a23fa3368e
gh-117945: Fix `os.path.ismount()` documentation (#117947) 2024-04-16 15:55:53 -07:00
Douglas Thor 1316692e8c
gh-102402: Fix floating point math issue by using `time.time_ns()` in `logging.LogRecord` (GH-102412) 2024-04-16 10:44:57 +01:00
Inada Naoki 6dc661bc9f
gh-77102: site: try utf-8 and fallback to locale encoding when reading .pth file (#117802) 2024-04-16 12:56:16 +09:00
Hugo van Kemenade 3375282bb8
Docs: add link roles with Sphinx extlinks (#117850)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-15 21:22:00 +03:00
Raymond Hettinger 0823f43618
gh-115532: Minor tweaks to kde() (gh-117897) 2024-04-15 10:08:21 -05:00
Erlend E. Aasland e01831760e
Doc: mark up classes, attributes, parameters, and methods in dataclasses.rst (#117820) 2024-04-14 16:29:01 +00:00
Jelle Zijlstra c99d374fc7
dataclasses docs: add some link anchors (#117601) 2024-04-14 01:03:16 -07:00
Gouvernathor f303651b45
Simpler example of shallow dict export of a dataclass (#117812) 2024-04-13 17:14:43 -07:00
Gouvernathor e7cce2a9c6
Tweak wording for dataclasses.replace (gh-117758) 2024-04-13 20:03:09 -04:00
Barney Gale a74f117dab
GH-115060: Speed up `pathlib.Path.glob()` by omitting initial `stat()` (#117831)
Since 6258844c, paths that might not exist can be fed into pathlib's
globbing implementation, which will call `os.scandir()` / `os.lstat()` only
when strictly necessary. This allows us to drop an initial `self.is_dir()`
call, which saves a `stat()`.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-04-14 00:08:03 +01:00
Hugo van Kemenade 56ed979d04
gh-68583: webbrowser: replace `getopt` with `argparse`, add long options (#117047) 2024-04-13 08:56:56 -06:00
Michiel W. Beijen 022ba6d161
gh-102247: http: support rfc9110 status codes (GH-117611)
rfc9110 obsoletes the earlier rfc 7231. This document also includes some
status codes that were previously only used for WebDAV and assigns more
generic names to these status codes.

ref: https://www.rfc-editor.org/rfc/rfc9110.html#name-changes-from-rfc-7231

- http.HTTPStatus.CONTENT_TOO_LARGE (413, previously
  REQUEST_ENTITY_TOO_LARGE)
- http.HTTPStatus.URI_TOO_LONG (414, previously REQUEST_URI_TOO_LONG)
- http.HTTPStatus.RANGE_NOT_SATISFYABLE (416, previously
  REQUEST_RANGE_NOT_SATISFYABLE)
- http.HTTPStatus.UNPROCESSABLE_CONTENT (422, previously
  UNPROCESSABLE_ENTITY)

The new constants are added to http.HTTPStatus and the old constant names are
preserved for backwards compatibility.

References in documentation to the obsoleted rfc 7231 are updated
2024-04-13 07:33:20 -07:00
Hugo van Kemenade dd724239dd
gh-117840: Fix indent to fix shlex syntax highlighting (#117843) 2024-04-13 05:31:01 -06:00
Shantanu 37a4cbd872
gh-114466: explicitly define heap invariant (#117778)
I think the choice of wording in these docs is great and doesn't
need to change. However, it could be useful to explicitly define
this term / the cost of doing so seems relatively low.
2024-04-13 00:05:27 -07:00
Hugo van Kemenade 94e9c35cd0
Fix version directive indents (#117719) 2024-04-12 13:30:42 +03:00
Tomas R c06be6bbb8
gh-104269: Document `glob.glob` duplicates when using multiple `**` patterns (#105406) 2024-04-11 15:16:39 +00:00
Bruce Merry 01a51f9494
gh-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723)
gh-16429 introduced support for an iterable of separators in
Stream.readuntil. Since bytes-like types are themselves iterable, this
can introduce ambiguities in deciding whether the argument is an
iterator of separators or a singleton separator. In gh-16429, only 'bytes'
was considered a singleton, but this will break code that passes other
buffer object types.

Fix it by only supporting tuples rather than arbitrary iterables.

Closes gh-117722.
2024-04-11 07:41:55 -07:00
Mikhail B 898f6de63f
gh-101549: fix documentation of xml.etree.ElementInclude (#101550)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-11 14:23:52 +00:00
Nikita Sobolev be82058064
Fix markup of `win32_ver` in `platform.rst` (#116492) 2024-04-11 17:13:53 +03:00
Barney Gale 630df37116
GH-117546: Fix symlink resolution in `os.path.realpath('loop/../link')` (#117568)
Continue resolving symlink targets after encountering a symlink loop, which
matches coreutils `realpath` behaviour.
2024-04-10 18:17:18 +01:00
Laurie O 6bc0b33a91
gh-117531: Unblock getters after non-immediate queue shutdown (#117532)
(This is a small tweak of the original gh-104750 which added shutdown.)
2024-04-10 08:01:42 -07:00
Nice Zombies 73906d5c90
gh-117360: Clearer wording in os.path.lexists() docs (#117679)
Co-authored-by: Zachary Ware <zach@python.org>
2024-04-09 23:00:41 +02:00
Guido van Rossum fa58e75a86
gh-116720: Fix corner cases of taskgroups (#117407)
This prevents external cancellations of a task group's parent task to
be dropped when an internal cancellation happens at the same time.
Also strengthen the semantics of uncancel() to clear self._must_cancel
when the cancellation count reaches zero.

Co-Authored-By: Tin Tvrtković <tinchester@gmail.com>
Co-Authored-By: Arthur Tacca
2024-04-09 08:17:28 -07:00
Jelle Zijlstra f2132fcd2a
gh-117516: Implement typing.TypeIs (#117517)
See PEP 742.

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-09 10:50:37 +00:00
Bruce Merry 775912a51d
gh-81322: support multiple separators in StreamReader.readuntil (#16429) 2024-04-08 09:58:02 -07:00
Laurie O e16062dd34
gh-96471: Correct documentation for asyncio queue shutdown (#117621) 2024-04-08 14:50:54 +00:00
Nikita Sobolev a7702663e3
gh-111726: Explicitly close database connections in sqlite3 doctests (#111730)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-08 09:29:47 +00:00
Erlend E. Aasland e338e1a4ec
gh-111726: Remove some doctests from sqlite3 docs (#117623)
* remove load extension doctest since we cannot skip it conditionally
* remove sys.unraisablehook example; using unraisable hooks is not "an
  improved debug experience"
2024-04-08 08:11:08 +00:00
Hugo van Kemenade a453f5ef9d
gh-111726: Cleanup test files after running sqlite3 doctest (#117604)
Remove all temporary databases in a dedicated 'testcleanup' step
at the end of the file.
2024-04-08 08:35:48 +02:00
Anita Hammer fd3679025d
Fix reference in code.rst (#117615)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-07 22:58:57 +00:00
Laurie O df4d84c3cd
gh-96471: Add asyncio queue shutdown (#104228)
Co-authored-by: Duprat <yduprat@gmail.com>
2024-04-06 07:27:13 -07:00
Barney Gale 6150bb2412
GH-77609: Add recurse_symlinks argument to `pathlib.Path.glob()` (#117311)
Replace tri-state `follow_symlinks` with boolean `recurse_symlinks` argument. The new argument controls whether symlinks are followed when expanding recursive `**` wildcards. The possible argument values correspond as follows:

    follow_symlinks  recurse_symlinks
    ===============  ================
    False            N/A
    None             False
    True             True

We therefore drop support for not following symlinks when expanding non-recursive pattern parts; it wasn't requested in the original issue, and it's a feature not found in any shells.

This makes the API a easier to grok by eliminating `None` as an option.

No news blurb as `follow_symlinks` was new in 3.13.
2024-04-05 18:51:54 +00:00
Petr Viktorin 9ceaee74db
gh-116608: importlib.resources: Un-deprecate functional API & add subdirectory support (GH-116609) 2024-04-05 13:55:59 +02:00
Sam Gross 42205143f8
gh-117478: Add `@support.requires_gil_enabled` decorator (#117479)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-04-04 14:10:46 -04:00
Vinay Sajip df912c913a
[doc] Update logging documentation to improve grammar and elucidate an example. (GH-117541) 2024-04-04 13:14:44 +01:00
Zackery Spytz fc5f68e58e
gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242) 2024-04-03 16:17:13 +02:00
Gregory P. Smith 33ee5cb3e9
GH-70647: Deprecate strptime day of month parsing without a year present to avoid leap-year bugs (GH-117107) 2024-04-03 14:19:49 +02:00
Petr Viktorin e569f9132b
gh-117074: Update Traversable.joinpath docs to the 3.11+ protocol (GH-117113) 2024-04-02 16:08:16 +02:00
Moshe Kaplan 9dae05ee59
Docs: specify XML document name in xml.etree.elementtree example (#24223) 2024-04-01 19:53:00 +00:00
Matthew Davis fc2071687b
Docs: add more links to PIPE in subprocess docs (#25416) 2024-04-01 21:49:14 +02:00
Justin Turner Arthur c741ad3537
gh-77714: Provide an async iterator version of as_completed (GH-22491)
* as_completed returns object that is both iterator and async iterator
* Existing tests adjusted to test both the old and new style
* New test to ensure iterator can be resumed
* New test to ensure async iterator yields any passed-in Futures as-is

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2024-04-01 20:07:29 +03:00
Adorilson Bezerra 56e99307c4
Doc: printf-style library/stdtype improvements (#16741) 2024-03-31 22:34:54 +00:00
Shantanu 262445358e
Link to the Python type system specification (#117400) 2024-03-31 12:02:48 -07:00
Barney Gale 752e18389e
GH-114575: Rename `PurePath.pathmod` to `PurePath.parser` (#116513)
And rename the private base class from `PathModuleBase` to `ParserBase`.
2024-03-31 19:14:48 +01:00
Pedro Lacerda 54f7e14500
gh-66449: configparser: Add support for unnamed sections (#117273)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-03-29 15:05:00 +00:00
Christopher Chianelli a17f313e39
gh-117339: Use NULL instead of None for LOAD_SUPER_ATTR in dis docs (GH-117343) 2024-03-29 06:26:56 +08:00
Malcolm Smith 29829b58a8
gh-117294: Report DocTestCase as skipped if all examples in the doctest are skipped (GH-117297) 2024-03-28 21:59:12 +02:00
Joachim Wuttke 9a388b9a64
bpo-43848: explain optional argument mtime in gzip.py. (GH-25410)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-28 13:43:07 +00:00
Russell Keith-Magee 0f27672c50
gh-114099: Add documentation for iOS platform (GH-117057)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Ned Deily <nad@python.org>
2024-03-28 04:13:13 -04:00
Russell Keith-Magee f006338017
gh-114099: Additions to standard library to support iOS (GH-117052)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Ned Deily <nad@python.org>
2024-03-28 03:59:33 -04:00