summaryrefslogtreecommitdiffstats
path: root/Doc
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)Sergey B Kirpichev2024-11-265-18/+93
| | | | | | | | | | | | | | | "Generally, mixed-mode arithmetic combining real and complex variables should be performed directly, not by first coercing the real to complex, lest the sign of zero be rendered uninformative; the same goes for combinations of pure imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for complex elementary functions. This patch implements mixed-mode arithmetic rules, combining real and complex variables as specified by C standards since C99 (in particular, there is no special version for the true division with real lhs operand). Most C compilers implementing C99+ Annex G have only these special rules (without support for imaginary type, which is going to be deprecated in C2y).
* gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib (#124415)Jelle Zijlstra2024-11-261-0/+11
|
* GH-126985: move pyvenv.cfg detection from site to getpath (#126987)Filipe Laíns 🇵🇸2024-11-265-41/+112
|
* Doc: Typo fix: nrace -> race (#127288)Richard Hansen2024-11-261-1/+1
|
* gh-101100: Fix sphinx warnings in `howto/*` (#127084)Yuki Kobayashi2024-11-263-102/+101
|
* gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127267)funkyrailroad2024-11-251-1/+1
|
* GH-127236: `pathname2url()`: generate RFC 1738 URL for absolute POSIX path ↵Barney Gale2024-11-251-4/+6
| | | | | | | | | | | | | | | (#127194) When handed an absolute Windows path such as `C:\foo` or `//server/share`, the `urllib.request.pathname2url()` function returns a URL with an authority section, such as `///C:/foo` or `//server/share` (or before GH-126205, `////server/share`). Only the `file:` prefix is omitted. But when handed an absolute POSIX path such as `/etc/hosts`, or a Windows path of the same form (rooted but lacking a drive), the function returns a URL without an authority section, such as `/etc/hosts`. This patch corrects the discrepancy by adding a `//` prefix before drive-less, rooted paths when generating URLs.
* gh-107954: Document PEP 741 in What's New 3.14 (#127056)Victor Stinner2024-11-252-0/+40
|
* Replace `:platform:` with `.. availability::` in `socket.ioctl` doc. (GH-127122)Jun Komoda2024-11-251-2/+3
| | | In `socket.ioctl`, `:platform:` -> `.. availability::`
* Improve `pathname2url()` and `url2pathname()` docs (#127125)Barney Gale2024-11-241-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | These functions have long sown confusion among Python developers. The existing documentation says they deal with URL path components, but that doesn't fit the evidence on Windows: >>> pathname2url(r'C:\foo') '///C:/foo' >>> pathname2url(r'\\server\share') '////server/share' # or '//server/share' as of quite recently If these were URL path components, they would imply complete URLs like `file://///C:/foo` and `file://////server/share`. Clearly this isn't right. Yet the implementation in `nturl2path` is deliberate, and the `url2pathname()` function correctly inverts it. On non-Windows platforms, the behaviour until quite recently is to simply quote/unquote the path without adding or removing any leading slashes. This behaviour is compatible with *both* interpretations -- 1) the value is a URL path component (existing docs), and 2) the value is everything following `file:` (this commit) The conclusion I draw is that these functions operate on everything after the `file:` prefix, which may include an authority section. This is the only explanation that fits both the Windows and non-Windows behaviour. It's also a better match for the function names.
* Fix macro expansions in critical section docs (#127226)da-woods2024-11-241-2/+2
|
* gh-101100: Fix sphinx warnings of removed opcodes (#127222)Yuki Kobayashi2024-11-246-16/+16
|
* GH-127133: Remove ability to nest argument groups & mutually exclusive ↵Savannah Ostrowski2024-11-242-10/+17
| | | | groups (#127186)
* Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (#126667)Richard Hansen2024-11-231-1/+5
|
* GH-125866: Preserve Windows drive letter case in file URIs (#127138)Barney Gale2024-11-231-0/+7
| | | | | Stop converting Windows drive letters to uppercase in `urllib.request.pathname2url()` and `url2pathname()`. This behaviour is unnecessary and inconsistent with pathlib's file URI implementation.
* GH-127134: Add note about forward compatibility for suggest_on_error (#127137)Savannah Ostrowski2024-11-231-0/+8
|
* Fix a few typos found in the docs (GH-127126)Rafael Fontenelle2024-11-233-4/+4
|
* gh-86463: Fix a trailing space in argparse.rst (#127162)Serhiy Storchaka2024-11-221-1/+1
|
* gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035)Serhiy Storchaka2024-11-221-6/+0
| | | | | | | | | * Name without a PATHEXT extension is only searched if the mode does not include X_OK. * Support multi-component PATHEXT extensions (e.g. ".foo.bar"). * Support files without extensions in PATHEXT contains dot-only extension (".", "..", etc). * Support PATHEXT extensions that end with a dot (e.g. ".foo.").
* gh-86463: Fix default prog in subparsers if usage is used in the main parser ↵Serhiy Storchaka2024-11-221-0/+10
| | | | | | | | | | (GH-125891) The usage parameter of argparse.ArgumentParser no longer affects the default value of the prog parameter in subparsers. Previously the full custom usage of the main parser was used as the prog prefix in subparsers.
* gh-127082: Replace "Windows only" with the `availability: Windows` in ↵Jun Komoda2024-11-221-15/+48
| | | | `ctypes` doc (#127099)
* GH-122679: Add `register()` to argparse docs (#126939)Savannah Ostrowski2024-11-221-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add register() to argparse docs * Add newline * Formatting * Fix codeblock * Move section * Add signature * Add newline * Fix indent * Fix indent take 2 * Rephrase * Simplify language * Address PR comments * Add references to register in type and action * Remove unnecessary reference * Rephrase and add success case
* GH-126601: `pathname2url()`: handle NTFS alternate data streams (#126760)Barney Gale2024-11-221-0/+5
| | | | | | Adjust `pathname2url()` to encode embedded colon characters in Windows paths, rather than bailing out with an `OSError`. Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730)Serhiy Storchaka2024-11-211-4/+6
| | | | | It now returns multiple era description segments separated by semicolons. Previously it only returned the first segment on platforms with Glibc.
* GH-127010: Don't lazily track and untrack dicts (GH-127027)Mark Shannon2024-11-201-2/+0
|
* gh-97514: Authenticate the forkserver control socket. (GH-99309)Gregory P. Smith2024-11-201-0/+5
| | | | | | | | | | | | | | | | | | | This adds authentication to the forkserver control socket. In the past only filesystem permissions protected this socket from code injection into the forkserver process by limiting access to the same UID, which didn't exist when Linux abstract namespace sockets were used (see issue) meaning that any process in the same system network namespace could inject code. We've since stopped using abstract namespace sockets by default, but protecting our control sockets regardless of type is a good idea. This reuses the HMAC based shared key auth already used by `multiprocessing.connection` sockets for other purposes. Doing this is useful so that filesystem permissions are not relied upon and trust isn't implied by default between all processes running as the same UID with access to the unix socket. ### pyperformance benchmarks No significant changes. Including `concurrent_imap` which exercises `multiprocessing.Pool.imap` in that suite. ### Microbenchmarks This does _slightly_ slow down forkserver use. How much so appears to depend on the platform. Modern platforms and simple platforms are less impacted. This PR adds additional IPC round trips to the control socket to tell forkserver to spawn a new process. Systems with potentially high latency IPC are naturally impacted more. Typically a 1-4% slowdown on a very targeted process creation microbenchmark, with a worst case overloaded system slowdown of 20%. No evidence that these slowdowns appear in practical sense. See the PR for details.
* gh-126615: `ctypes`: Make `COMError` public (GH-126686)Jun Komoda2024-11-202-6/+44
| | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* GH-84850: Improve whatsnew entry for `[Fancy]URLopener` removal (#127032)Barney Gale2024-11-201-0/+7
|
* gh-123299: Copyedit "What's New in Python 3.14" (#127028)Hugo van Kemenade2024-11-201-17/+17
|
* Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (#126536)Richard Hansen2024-11-201-0/+3
|
* Merge remote-tracking branch 'upstream/main'Hugo van Kemenade2024-11-191-1/+1
|\
| * Update docs 'make serve' to suggest 'make htmllive' (#126969)Hugo van Kemenade2024-11-191-1/+1
| |
* | Python 3.14.0a2v3.14.0a2Hugo van Kemenade2024-11-1910-16/+16
|/
* GH-84850: Remove `urllib.request.URLopener` and `FancyURLopener` (#125739)Barney Gale2024-11-193-125/+8
|
* gh-85957: Add missing MIME types for images with RFCs (#126966)Hugo van Kemenade2024-11-181-0/+11
|
* gh-123803: Support arbitrary code page encodings on Windows (GH-123804)Serhiy Storchaka2024-11-182-0/+10
| | | | | | If the cpXXX encoding is not directly implemented in Python, fall back to use the Windows-specific API codecs.code_page_encode() and codecs.code_page_decode().
* Doc: Reorganize math module documentation (#126337)Joseph Martinot-Lagarde2024-11-181-226/+250
| | | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* gh-126896: Fix docs about `asyncio.start_server()` (#126897)beavailable2024-11-171-1/+5
|
* GH-126748: amend configure.rst description for the 'build_wasm' make target ↵Hood Chatham2024-11-161-1/+2
| | | | | (#126687) Clarified the documentation around how the build_wasm target is selected.
* gh-126691: Remove --with-emscripten-target (#126787)Hood Chatham2024-11-161-9/+0
| | | | | This unifies the code for nodejs and the code for the browser. After this commit, the browser example doesn't work; this will be fixed in a subsequent update.
* Added a warning to the urljoin docs, indicating that it is not safe to use ↵Alex Gaynor2024-11-151-0/+9
| | | | | with attacker controlled URLs (GH-126659) This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
* Docs: Miscellaneous corrections to simple statements in the language ↵Beomsoo Kim2024-11-151-8/+8
| | | | | | | | reference (GH-126720) * Replace: The :keyword:`global` -> The :keyword:`global` statement Add :keyword: when it's needed * Replace repeated links with duoble backticks
* Add PEP 761 to What's New (#126550)Seth Michael Larson2024-11-151-0/+10
| | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-122549: Add platform.invalidate_caches() (#122547)Bénédikt Tran2024-11-152-0/+20
| | | Allow to invalidate platform's cached results.
* gh-125063: marshal: Add version 5, improve documentation (GH-126829)Petr Viktorin2024-11-152-22/+51
| | | | | | | | | | * Document that slices can be marshalled * Deduplicate and organize the list of supported types in docs * Organize the type code list in marshal.c, to make it more obvious that this is a versioned format * Back-fill some historical info Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* gh-89083: small docs fixup for UUIDv8 (#126857)Bénédikt Tran2024-11-151-3/+6
|
* gh-126061: add new functions to `refcounts.dat` (#126788)RUANG (James Roy)2024-11-141-0/+13
|
* gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance ↵Petr Viktorin2024-11-141-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-126182) * gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance This changes nothing changes for CPython supported platforms, but hints how to deal with platforms that stick to the letter of the spec. It also marks `socket.getaddrinfo` as a wrapper around `getaddrinfo(3)`; specifically, workarounds to make the function work consistently across platforms are out of scope in its code. Include wording similar to the POSIX's “by providing options and by limiting the returned information”, which IMO suggests that the hints limit the resulting list compared to the defaults, *but* can be interpreted differently. Details are added in a note. Specifically say that this wraps the underlying C function. So, the details are in OS docs. The “full range of results” bit goes away. Use `AF_UNSPEC` rather than zero for the *family* default, although I don't think a system where it's nonzero would be very usable. Suggest setting proto and/or type (with examples, as the appropriate values aren't obvious). Say why you probably want to do that that on all systems; mention the behavior on the “letter of the spec” systems. Suggest that the results should be tried in order, which is, AFAIK best practice -- see RFC 6724 section 2, and its predecessor from 2003 (which are specific to IP, but indicate how people use this): > Well-behaved applications SHOULD iterate through the list of > addresses returned from `getaddrinfo()` until they find a working address. Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* Document that return-less user-defined functions return None (#126769)John Marshall2024-11-141-1/+2
| | | | Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* Doc: Recommend shlex.quote alongside pipes removal (#126570)Colin Watson2024-11-141-0/+2
| | | | | | | One of the most common reasons I see the old `pipes` module still in use when porting to Python 3.13 is for the undocumented `pipes.quote` function, which can easily be replaced with `shlex.quote`. I think it's worth specifically calling this out, since being directed to the `subprocess` module would be confusing in this case.