Commit graph

125635 commits

Author SHA1 Message Date
Victor Stinner
bfabf96b50
gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (#127358)
Replace the sleep(2) with a task which is blocked forever.
2024-11-29 11:39:54 +01:00
Peter Bierma
99490913a0
gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (#127310)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-11-29 11:12:13 +01:00
Kumar Aditya
762c603a86
gh-126881: fix finalization of dtoa state (#126904) 2024-11-29 15:17:16 +05:30
Илья Любавский
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
Hugo van Kemenade
b83be9c971
gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365) 2024-11-28 19:03:09 +02:00
Victor Stinner
20657fbdb1
gh-127190: Fix local_setattro() error handling (#127366)
Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.
2024-11-28 17:35:48 +01: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
Petr Viktorin
db5c5763f3
gh-127330: Update for OpenSSL 3.4 & document+improve the update process (GH-127331)
- Add `git describe` output to headers generated by `make_ssl_data.py`

  This info is more important than the date when the file was generated.
  It does mean that the tool now requires a Git checkout of OpenSSL,
  not for example a release tarball.

- Regenerate the older file to add the info.
  To the other older file, add a note about manual edits.

- Add notes on how to add a new OpenSSL version

- Add 3.4 error messages and multissl tests
2024-11-28 13:29:27 +01:00
Filipe Laíns 🇵🇸
3a77980002
GH-127178: install a _sysconfig_vars_(...).json file in the stdlib directory (#127302) 2024-11-27 23:32:54 +00:00
Savannah Ostrowski
2247dd0f11
GH-127154: Remove PGO and unknown-linux-gnu/clang from JIT CI (#127212) 2024-11-27 14:36:36 -08:00
Bénédikt Tran
78cb377c62
gh-122288: Improve performances of fnmatch.translate (#122289)
Improve performance of this function by a factor of 1.7x.

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-27 16:42:45 +00:00
Topher Fischer
14a05a8f43
gh-126882: Fix indentation in code sample block (#126887) 2024-11-27 15:24:45 +00:00
Victor Stinner
58e334e143
gh-123967: Fix faulthandler for trampoline frames (#127329)
If the top-most frame is a trampoline frame, skip it.
2024-11-27 16:14:49 +01:00
Jelle Zijlstra
9328db7652
Fix indentation for contextlib.asynccontextmanager docs (#127333) 2024-11-27 06:38:55 -08:00
Serhiy Storchaka
3cf83d91a5
gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059)
Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if
the data contains invalid UTF-8 sequences, use binary search to
calculate the number of written bytes from the number of written
characters.

Also fix writing incomplete UTF-8 sequences.

Also fix handling of memory allocation failures.
2024-11-27 13:38:12 +02:00
Serhiy Storchaka
83926d3b4c
gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) 2024-11-27 13:29:50 +02:00
RUANG (James Roy)
6d3b5206cf
gh-127072: Remove outdated socket.NETLINK_* constants. (GH-127256)
Remove seriously outdated netlink constants.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-11-27 06:53:41 +00:00
Sam Gross
71ede1142d
gh-115999: Add free-threaded specialization for STORE_SUBSCR (#127169)
The specialization only depends on the type, so no special thread-safety
considerations there.

STORE_SUBSCR_LIST_INT needs to lock the list before modifying it.

`_PyDict_SetItem_Take2` already internally locks the dictionary using a
critical section.
2024-11-26 16:46:06 -05:00
Sergey B Kirpichev
f0d3f10c43
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 20:20:37 +02:00
Sergey Muraviov
6da9d252ac
gh-127285: Update PCbuild files for a number of missed changes (GH-127286) 2024-11-26 16:39:33 +00: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
Petr Viktorin
0c1feebf95
gh-113993: InternalDocs: Add String Interning to README (#127250) 2024-11-26 11:06:57 +01:00
Malcolm Smith
4ca2c82862
gh-124873: Skip timerfd tests on Android (#127279)
* Revert "[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)"

This reverts commit c09366b1fe.

* Skip timerfd tests on Android.

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-26 09:46:46 +00:00
Victor Stinner
3c7a90a831
gh-122273: Support PyREPL history on Windows (#127141)
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-11-26 10:21:57 +01:00
Beomsoo Kim
f46d847574
gh-126946: Improve error message in getopt.do_longs based on existing comment (GH-126871)
Include a list of possibilities for not unique prefix.
2024-11-26 10:54:02 +02:00
Yuki Kobayashi
733fe59206
gh-101100: Fix sphinx warnings in howto/* (#127084) 2024-11-26 10:17:54 +02:00
Marc Mueller
4fd9eb2aca
Fix typo: Use AsyncFor element access in codegen (#127278)
Use AsyncFor element access in codegen
2024-11-26 01:00:46 +00:00
mpage
193890c1cc
gh-126612: Include stack effects of uops when computing maximum stack depth (#126894) 2024-11-26 00:53:49 +00: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
sobolevn
a2ee899682
gh-127182: Fix io.StringIO.__setstate__ crash when None is the first value (#127219)
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-25 20:32:02 +03:00
Sam Gross
d3da04bfc9
gh-127022: Remove _PyEvalFramePushAndInit_UnTagged (gh-127168)
The interpreter now handles `_PyStackRef`s pointing to immortal objects
without the deferred bit set, so `_PyEvalFramePushAndInit_UnTagged` is
no longer necessary.
2024-11-25 12:24:37 -05:00
Sergey Muraviov
3e7ce6e9ae
gh-127248: Fix several removed or misnamed files in pythoncore.vcxproj (GH-127249) 2024-11-25 14:56:46 +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
c7f1e3e150
gh-127183: Add _ctypes.CopyComPointer tests (GH-127184)
* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
2024-11-25 14:55:07 +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
Sergey B Kirpichev
c595eae84c
gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241)
Now it's correct and closer to Python/initconfig.c
2024-11-25 00:29:55 -05:00
Brandt Bucher
17c16aea66
GH-115869: Make jit_stencils.h reproducible (GH-127166) 2024-11-24 14:42:50 -08: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
Serhiy Storchaka
97b2ceaaaf
gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) 2024-11-24 19:30:29 +02:00
da-woods
2bb7846cac
Fix macro expansions in critical section docs (#127226) 2024-11-24 12:21:02 -05:00
Bénédikt Tran
e0ef08f5b4
gh-122356: restore the position of a file-like object after zipfile.is_zipfile (#122397) 2024-11-24 11:36:15 -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
Sergey B Kirpichev
f7bb658124
gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211)
`x**y == 1/x**-y ` thus changing `/=` to `*=` by negating the exponent.
2024-11-23 23:37:37 -08:00
Stephen Morton
a4d4c1ede2
gh-126662: harmonize naming for three namedtuple base classes in urllib.parse (GH-126663)
harmonize naming for three namedtuple base classes in urllib.parse
2024-11-23 18:36:48 -08:00
Barney Gale
4ea71278ca
pathlib tests: move walk() tests into their own classes (GH-126651)
Move tests for Path.walk() into a new PathWalkTest class, and apply a similar change in tests for the ABCs. This allows us to properly tear down the walk test hierarchy in tearDown(), rather than leaving it to os_helper.rmtree().
2024-11-23 18:31:00 -08:00