Commit Graph

123224 Commits

Author SHA1 Message Date
Serhiy Storchaka 1bb955a2fe
gh-122459: Optimize pickling by name objects without __module__ (GH-122460) 2024-08-05 16:21:32 +03:00
Irit Katriel 1422500d02
gh-121367: [doc] BUILD_TUPLE arg can be 0 (#122663) 2024-08-05 10:17:55 +01:00
dependabot[bot] 5207adf228
build(deps-dev): bump mypy from 1.10.1 to 1.11.1 in /Tools (#122550)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-08-05 09:03:14 +00:00
Jonathan Protzenko d0b92dd5ca
gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574)
Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-08-04 23:22:51 +00:00
Damien 3bde3d8e03
Add `3.13` and remove `3.7` in Azure Pipelines (#122670) 2024-08-04 19:57:20 +03:00
Libor Martínek f5c39b3e9c
gh-122661: Remove GNU make-specific directive from Doc/Makefile (#122662) 2024-08-04 17:02:29 +03:00
Sergey B Kirpichev e6fad7a0e3
gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj (#122638)
As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return
0 + i NaN (with "invalid" exception in the second case).  This has
corresponding implications for ctan(z), as its errors and special cases
are handled as if the operation is implemented by -i*ctanh(i*z).
This patch fixes cmath's code to do same.

Glibs patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d15e83c5f5231d971472b5ffc9219d54056ca0f1
2024-08-04 10:05:30 +01:00
Sergey B Kirpichev 3462a80d2c
gh-121889: cmath.acosh(0+nanj) returns nan+pi/2j (#121892)
As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 +
iNaN) should return NaN ± i pi/2, not NaN + iNaN.  This patch
fixes cmath's code to do same.
2024-08-04 09:53:17 +01:00
sobolevn 151934a324
gh-122623: Improve `c-api/bytearray.rst` with error handling info (#122624) 2024-08-04 00:55:47 +03:00
Adam Turner 95f5c89b54
GH-121970: Fix ``gettext`` for audit events (#122651) 2024-08-03 17:41:26 +01:00
Adam Turner 1573d90ce1
gh-109408: Remove ``.azure-pipelines/pr.yml`` (#122643)
This no longer does anything useful, beyond wasting Azure resources.
2024-08-03 16:11:48 +01:00
scottwoodall 06eb9701a1
Doc: Grammar fix in ``library/ssl.rst``, 'Verifying certificates' (#122646) 2024-08-03 14:24:29 +01:00
neonene 50b3603751
gh-122334: Fix test_embed failure when missing _ssl module (GH-122630)
Co-authored-by: Wulian233 <1055917385@qq.com>
2024-08-03 15:15:26 +02:00
Adam Turner cc6839a181
GH-109408: Stop running patchcheck in CI (#109895) 2024-08-03 12:52:21 +01:00
Sergey B Kirpichev d91ac525ef
gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-#122280) 2024-08-03 13:20:10 +02:00
Matth-M 7a5c4103b0
Doc: Improve wording of ``os.path.commonpath()`` (#122627)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-03 11:18:59 +00:00
Serhiy Storchaka efcd65cd84
gh-122313: Clean up deep recursion guarding code in the compiler (GH-122640)
Add ENTER_RECURSIVE and LEAVE_RECURSIVE macros in ast.c, ast_opt.c and
symtable.c. Remove VISIT_QUIT macro in symtable.c.

The current recursion depth counter only needs to be updated during
normal execution -- all functions should just return an error code
if an error occurs.
2024-08-03 12:45:45 +03:00
Irit Katriel fe0a28d850
gh-122560: add test that comprehension loop var appears only in one scope of the symtable (#122582) 2024-08-02 23:56:51 +01:00
Sam Gross 4b63cd170e
gh-122527: Fix a crash on deallocation of `PyStructSequence` (GH-122577)
The `PyStructSequence` destructor would crash if it was deallocated after
its type's dictionary was cleared by the GC, because it couldn't compute
the "real size" of the instance. This could occur with relatively
straightforward code in the free-threaded build or with a reference
cycle involving the type in the default build, due to differing orders
in which `tp_clear()` was called.

Account for the non-sequence fields in `tp_basicsize` and use that,
along with `Py_SIZE()`, to compute the "real" size of a
`PyStructSequence` in the dealloc function. This avoids the accesses to
the type's dictionary during dealloc, which were unsafe.
2024-08-02 18:11:44 +02:00
Mark Shannon 7aca84e557
GH-117224: Move the body of a few large-ish micro-ops into helper functions (GH-122601) 2024-08-02 16:31:17 +01:00
Irit Katriel 498376d7a7
gh-122445: populate only modified fields in __static_attributes__ (#122446) 2024-08-02 15:40:42 +01:00
neonene 9fc1c992d6
gh-122334: Fix crash when importing ssl after re-initialization (#122481)
* Fix crash when importing ssl after re-initialization
2024-08-02 19:06:20 +05:30
Sam Gross b5e6fb39a2
gh-120974: Make asyncio `swap_current_task` safe in free-threaded build (#122317)
* gh-120974: Make asyncio `swap_current_task` safe in free-threaded build
2024-08-02 19:02:08 +05:30
Bénédikt Tran fb864c76cd
gh-121723: Relax constraints on queue objects for `logging.handlers.QueueHandler`. (GH-122154) 2024-08-02 12:16:32 +01:00
Victor Stinner addbb73927
Update PyObject_Del() documentation (#122597)
Replace PyMem_Del() with PyMem_Free().
2024-08-02 12:13:33 +02:00
Serhiy Storchaka 03b88522f5
gh-122188: Remove _imp.pyc_magic_number (GH-122503)
_imp.pyc_magic_number_token should be enough.
2024-08-02 13:12:19 +03:00
Damien d57f8a9f76
gh-122544: Change OS image in readthedocs.yml to ubuntu-24.04 (#122568) 2024-08-02 09:09:27 +03:00
John Riggles 5a7f7c4864
gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (#120605)
On recent versions of macOS (sometime between Catalina and Sonoma 14.5), the default Hovertip foreground color changed from black to white, thereby matching the background. This might be a matter of matching the white foreground of the dark-mode text. The unreadable result is shown here (#120083 (comment)).

The foreground and background colors were made parameters so we can pass different colors for future additional hovertips in IDLE.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-08-01 23:02:43 -04:00
Jonathon Vandezande dbdbef3668
Fixes typo in idlelib/idle_test/example_stub.pyi (#122520)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-08-01 21:31:37 -04:00
Jelle Zijlstra 8234419c32
gh-122562: Remove ste_free and ste_child_free from symtable (#122563) 2024-08-01 16:28:25 -07:00
Mark Shannon df13a1821a
GH-118095: Add tier two support for BINARY_SUBSCR_GETITEM (GH-120793) 2024-08-01 16:19:05 -07:00
Victor Stinner fda6bd842a
Replace PyObject_Del with PyObject_Free (#122453)
PyObject_Del() is just a alias to PyObject_Free() kept for backward
compatibility. Use directly PyObject_Free() instead.
2024-08-01 14:12:33 +02:00
Bénédikt Tran 88030861e2
gh-122555: Remove removed functions from `Doc/data/refcounts.dat` (#122556) 2024-08-01 12:26:09 +02:00
Rafael Fontenelle 58ffc4cf4a
gh-122384: Mark strings from Download page for translation (#122385)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-01 12:25:16 +03:00
Mark Shannon a9d56e38a0
GH-122155: Track local variables between pops and pushes in cases generator (GH-122286) 2024-08-01 09:27:26 +01:00
jianghuyiyuan 46f5a4f9e1
Fix typos in docs, error messages and comments (#122502)
Signed-off-by: jianghuyiyuan <shuangcui@live.com>
2024-08-01 00:26:09 +00:00
Malcolm Smith 06656e259b
gh-116622: Don't expose `FICLONE` ioctl on Android (#122522)
Don't expose `FICLONE` ioctl on Android

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-08-01 00:23:10 +00:00
Malcolm Smith 8844197daa
gh-116622: Skip PosixPathTest.test_expanduser_pwd2 on platforms which don't support pwd.getpwall (GH-122521) 2024-07-31 21:35:10 +03:00
CF Bolz-Tereick bd3d31f380
gh-87320: In the code module, handle exceptions raised in sys.excepthook (GH-122456)
Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
2024-07-31 10:33:29 +00:00
Sviatoslav Sydorenko (Святослав Сидоренко) e60ee11cb5
Move change detection to separate workflow in CI (#122336) 2024-07-31 11:32:16 +03:00
Russell Keith-Magee f071f01b7b
gh-122133: Rework pure Python socketpair tests to avoid use of importlib.reload. (#122493)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-07-31 10:24:15 +02:00
Hugo van Kemenade d01fd24051
Docs: bump Sphinx to 8.0 and update constraints (#122496)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-31 07:02:08 +00:00
Cody Maloney a9344cdffa
gh-121381 Remove subprocess._USE_VFORK escape hatch (#121383)
This flag was added as an escape hatch in gh-91401 and backported to
Python 3.10. The flag broke at some point between its addition and now.
As there is currently no publicly known environments that require this,
remove it rather than work on fixing it.

This leaves the flag in the subprocess module to not break code which
may have used / checked the flag itself.

discussion: https://discuss.python.org/t/subprocess-use-vfork-escape-hatch-broken-fix-or-remove/56915/2
2024-07-30 18:39:54 -07:00
Malcolm Smith 82db572813
gh-116622: Fix testPyObjectPrintOSError on Android (#122487)
Adds extra handling for way BSD/Android return errors from calls to fwrite.
2024-07-31 08:21:43 +08:00
Terry Jan Reedy 29c04dfa27
GH-122482: Make About IDLE direct discussion to DPO (#122483)
Currently, idle-dev@python.org and idle-dev mailing list
serve to collect spam (90+%).  Change About IDLE to direct
discussions to discuss.python.org.  Users are already
doing so.
2024-07-30 18:29:52 -04:00
Petr Viktorin 0976339818
gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)
## Encode header parts that contain newlines

Per RFC 2047:

> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.


## Verify that email headers are well-formed

This should fail for custom fold() implementations that aren't careful
about newlines.


Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-31 00:19:48 +02:00
Petr Viktorin 5912487938
gh-120906: Support arbitrary hashable keys in FrameLocalsProxy (GH-122309)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-07-30 22:11:00 +00:00
Nate Ohlson 1cac0908fb
gh-112301: Add argument aliases and tee compiler output for check warnings (GH-122465)
Also remove superfluous shebang from the warning check script
2024-07-30 14:49:15 -05:00
Thomas Grainger c68cb8e0c9
Remove outdated note about instance methods from datamodel.rst (#122471) 2024-07-30 12:42:25 -07:00
Michael Droettboom af0a00f022
gh-122188: Move magic number to its own file (#122243)
* gh-122188: Move magic number to its own file

* Add versionadded directive

* Do work in C

* Integrate launcher.c

* Make _pyc_magic_number private

* Remove metadata

* Move sys.implementation -> _imp

* Modernize comment

* Move _RAW_MAGIC_NUMBER to the C side as well

* _pyc_magic_number -> pyc_magic_number

* Remove unused import

* Update docs

* Apply suggestions from code review

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>

* Fix typo in tests

---------

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-07-30 15:31:05 -04:00