Commit Graph

28892 Commits

Author SHA1 Message Date
Peter Bierma d5d84c3f13 gh-127791: Fix, document, and test PyUnstable_AtExit (#127793) 2024-12-11 12:14:04 +01:00
Russell Keith-Magee 51216857ca gh-126821: Add versionadded annotation to use_system_logger feature. (#127755)
Add versionadded annotation to use_system_logger feature.
2024-12-11 05:32:04 +08:00
Yuki Kobayashi 035f512046 Docs: Fix indents in xmlrpc.client.rst (#127782) 2024-12-10 19:35:00 +02:00
Victor Stinner c91ccbe4ac gh-59705: Set OS thread name when Thread.name is changed (#127702)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-10 17:33:11 +01:00
Yuki Kobayashi 8dbdbad6e0 gh-101100: Fix sphinx warnings in whatsnew/3.0.rst (#127662) 2024-12-10 12:22:37 +02:00
Bénédikt Tran 4331832db0 gh-125420: implement Sequence.count API on memoryview objects (#125443) 2024-12-10 10:12:33 +00:00
Hugo van Kemenade 212448b162 gh-127718: Add colour to test.regrtest output (#127719) 2024-12-10 09:44:15 +02:00
Bénédikt Tran 58c753827a gh-125420: implement Sequence.index API on memoryview objects (#125446) 2024-12-09 18:48:38 -08:00
Russell Keith-Magee 2041a95e68 gh-126925: Modify how iOS test results are gathered (#127592)
Adds a `use_system_log` config item to enable stdout/stderr redirection for
Apple platforms. This log streaming is then used by a new iOS test runner
script, allowing the display of test suite output at runtime. The iOS test
runner script can be used by any Python project, not just the CPython test
suite.
2024-12-09 13:28:57 +08:00
Yuki Kobayashi 77a61c0465 gh-101100: amend references starting with !~ in gh-127054 (#127684) 2024-12-06 16:09:20 +02:00
Barney Gale 8b3cccf3f9 GH-125413: Revert addition of pathlib.Path.scandir() method (#127377)
Remove documentation for `pathlib.Path.scandir()`, and rename the method to
`_scandir()`. In the private pathlib ABCs, make `iterdir()` abstract and
call it from `_scandir()`.

It's not worthwhile to add this method at the moment - see discussion:
https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2024-12-05 21:39:43 +00:00
Maciej Olko 657d0e99aa [Docs] GDB howto: Fix block type of a cast example (#127621) 2024-12-05 22:52:58 +02:00
Hugo van Kemenade 23f2e8f13c gh-127221: Add colour to unittest output (#127223)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-12-05 21:10:46 +02:00
Bénédikt Tran 67b9a5331a gh-127413: allow to show specialized bytecode via dis CLI (#127414) 2024-12-05 15:01:59 +00:00
Victor Stinner 1ef6e8ca3f gh-119182: Complete PyUnicodeWriter documentation (#127607) 2024-12-05 10:37:14 +01:00
RUANG (James Roy) 6bc3e830a5 gh-127481: Add EPOLLWAKEUP to the select module (GH-127482) 2024-12-04 14:30:38 +01:00
Bénédikt Tran bc0f2e9459 gh-123378: Ensure results of PyUnicode*Error_Get{Start,End} are clamped (GH-123380)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-12-04 14:13:52 +01:00
Raymond Hettinger 7f882c88cf Itertool recipe additions (gh-127483) 2024-12-03 18:20:01 -06:00
Neil Schemenauer fc5a0dc224 gh-127271: Replace use of PyCell_GET/SET (gh-127272)
* Replace uses of `PyCell_GET` and `PyCell_SET`.  These macros are not
  safe to use in the free-threaded build.  Use `PyCell_GetRef()` and
  `PyCell_SetTakeRef()` instead. 

* Since `PyCell_GetRef()` returns a strong rather than borrowed ref, some
  code restructuring was required, e.g. `frame_get_var()` returns a strong
  ref now.

* Add critical sections to `PyCell_GET` and `PyCell_SET`.

* Move critical_section.h earlier in the Python.h file.

* Add `PyCell_GET` to the free-threading howto table of APIs that return
  borrowed refs.

* Add additional unit tests for free-threading.
2024-12-03 10:33:06 -08:00
Tomas R. 8ba9f5bca9 gh-127347: Document traceback.print_list (#127348)
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
2024-12-03 18:08:39 +02:00
Jun Komoda 412e11fe6e gh-127255: Make CopyComPointer public and add to ctypes doc. (GH-127275) 2024-12-03 16:35:08 +01:00
RUANG (James Roy) 84ff1313d0 gh-126585: Add EHWPOISON error code (#126586) 2024-12-03 12:45:50 +00:00
Petr Viktorin 35d37d6592 gh-127253: Note that Stable ABI is about ABI stability (GH-127254) 2024-12-03 13:30:27 +01:00
Alexander Stepchenko 8c3fd1f245 docs(logging): fix phrasing from "operation on" to "operate on" (#127543) 2024-12-03 12:22:12 +05:30
Yuki Kobayashi 3e812253ab gh-101100: Fix Sphinx warnings about list methods (#127054) 2024-12-02 15:51:35 +02:00
Giovanni Siragusa 31f16e427b gh-109523: Raise a BlockingIOError if reading text from a non-blocking stream cannot immediately return bytes. (GH-122933) 2024-12-02 14:18:30 +01:00
Bénédikt Tran 1f8267b85d gh-127443: Fix some entries in Doc/data/refcounts.dat (#127451)
Fix incorrect entries in `Doc/data/refcounts.dat`
2024-12-02 10:21:00 +02:00
Zhikang Yan 7ea523f47c gh-126899: Add **kw to tkinter.Misc.after and tkinter.Misc.after_idle (#126900)
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-01 19:29:27 +00:00
Rafael Fontenelle a880358af0 gh-127356: Fix prepend doctrees directory for gettext target (#127357) 2024-12-01 11:15:44 +02:00
Yuki Kobayashi 33ce8dcf79 Docs: Fix incorrect indents in c-api/type.rst (#127449) 2024-11-30 15:01:15 +00:00
Ollanta Cuba Gyllensten 15d6506d17 Link to correct class methods in asyncio primitives docs (#127270) 2024-11-29 16:20:40 +00:00
biggus-developerus 3afb639f39 fix param type in PyObject_HasAttrWithError (docs) (#127403) 2024-11-29 10:53:34 +00:00
Илья Любавский dd3a87d2a8 gh-127303: Add docs for token.EXACT_TOKEN_TYPES (#127304)
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-29 04:00:50 -05:00
Jun Komoda 49fee592a4 Touch up docs for ctypes.FormatError & WinError (GH-127210)
Reformat paragraphs, add backquotes, and directives.
2024-11-28 16:59:47 +01:00
Jelle Zijlstra 9328db7652 Fix indentation for contextlib.asynccontextmanager docs (#127333) 2024-11-27 06:38:55 -08:00
Sergey B Kirpichev 987311d42e gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)
"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).
2024-11-26 17:57:39 +02:00
Jelle Zijlstra dcf629213b gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib (#124415) 2024-11-26 15:40:13 +00:00
Filipe Laíns 🇵🇸 2b0e2b2893 GH-126985: move pyvenv.cfg detection from site to getpath (#126987) 2024-11-26 13:46:33 +00:00
Richard Hansen ab237ff81d Doc: Typo fix: nrace -> race (#127288) 2024-11-26 15:05:07 +02:00
Yuki Kobayashi 733fe59206 gh-101100: Fix sphinx warnings in howto/* (#127084) 2024-11-26 10:17:54 +02:00
funkyrailroad 26ff32b305 gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127267) 2024-11-25 15:34:01 -06:00
Barney Gale 5bb059fe60 GH-127236: pathname2url(): generate RFC 1738 URL for absolute POSIX path (#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.
2024-11-25 19:59:20 +00:00
Victor Stinner d9331f1b16 gh-107954: Document PEP 741 in What's New 3.14 (#127056) 2024-11-25 15:24:33 +01:00
Jun Komoda f4f075b3d5 Replace :platform: with .. availability:: in socket.ioctl doc. (GH-127122)
In `socket.ioctl`, `:platform:` -> `.. availability::`
2024-11-25 13:53:17 +01:00
Barney Gale 307c633586 Improve pathname2url() and url2pathname() docs (#127125)
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.
2024-11-24 17:33:46 +00:00
da-woods 2bb7846cac Fix macro expansions in critical section docs (#127226) 2024-11-24 12:21:02 -05:00
Yuki Kobayashi 3d8ac48aed gh-101100: Fix sphinx warnings of removed opcodes (#127222) 2024-11-24 17:43:25 +02:00
Savannah Ostrowski 2104bde572 GH-127133: Remove ability to nest argument groups & mutually exclusive groups (#127186) 2024-11-24 15:20:37 +00:00
Richard Hansen e3038e976b Doc: C API: Fix Py_NewInterpreterFromConfig example code (#126667) 2024-11-23 21:47:08 +02:00
Barney Gale cc813e10ff GH-125866: Preserve Windows drive letter case in file URIs (#127138)
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.
2024-11-23 10:41:39 +00:00