Commit Graph

123217 Commits

Author SHA1 Message Date
Serhiy Storchaka 6094c6fc2f
gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788) 2024-08-08 09:48:11 +03:00
neonene 3f76b6b8ac
gh-120782: Update datetime test for static type immutability (#122800) 2024-08-08 10:05:06 +05:30
Tian Gao 57d7c3e78f
gh-122247: Move instruction instrumentation sanity check after tracing check (#122251) 2024-08-07 21:30:14 -07:00
Erlend E. Aasland e006c7371d
gh-105201: Add PyIter_NextItem() (#122331)
Return -1 and set an exception on error; return 0 if the iterator is
exhausted, and return 1 if the next item was fetched successfully.

Prefer this API to PyIter_Next(), which requires the caller to use
PyErr_Occurred() to differentiate between iterator exhaustion and errors.

Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
2024-08-08 00:47:15 +02:00
Serhiy Storchaka 540fcc62f5
gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664)
Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
2024-08-07 23:30:10 +03:00
Serhiy Storchaka e73e7a7abd
gh-122478: Remove internal frames from tracebacks in REPL (GH-122528)
Frames of methods in code and codeop modules was show with non-default
sys.excepthook.

Save correct tracebacks in sys.last_traceback and update __traceback__
attribute of sys.last_value and sys.last_exc.
2024-08-07 23:20:57 +03:00
Hugo van Kemenade 42d9bec98f
gh-118761: Improve import time of `pprint` (#122725)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-07 22:46:54 +03:00
Serhiy Storchaka f9637b4ba3
Remove dead code in the RE parser (GH-122796) 2024-08-07 19:44:18 +00:00
Serhiy Storchaka d2e5be1f39
gh-122798: Make tests for warnings in the re module more strict (GH-122799)
* Test warning messages.
* Test stack level for re.compile() and re.findall().
2024-08-07 19:43:49 +00:00
Sam Gross 3e753c689a
gh-118926: Spill deferred references to stack in cases generator (#122748)
This automatically spills the results from `_PyStackRef_FromPyObjectNew`
to the in-memory stack so that the deferred references are visible to
the GC before we make any possibly escaping call.

Co-authored-by: Ken Jin <kenjin@python.org>
2024-08-07 13:23:53 -04:00
smij720 967a4f1d18
Docs: Change `remove` to `removes` for consistency (#121072) 2024-08-07 16:30:00 +01:00
dependabot[bot] 19dd2dcbde
Bump types-setuptools to 71.1.0.20240726 in /Tools (#122551) 2024-08-07 16:20:37 +01:00
Lucas Esposito 0bd93755f3
gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047) 2024-08-07 16:07:26 +01:00
Wim Jeantine-Glenn c25898d51e
Doc: cmdline.rst: Include -P and -R in usage (#122590)
* ``-P``: safe path (https://docs.python.org/3/using/cmdline.html#cmdoption-P)
* ``-R``: hash randomization (https://docs.python.org/3/using/cmdline.html#cmdoption-R)
2024-08-07 16:01:44 +01:00
sobolevn 61a8bf2853
gh-122759: Remove `assert` from `RERAISE` error handling (#122760) 2024-08-07 17:25:25 +03:00
Bénédikt Tran 76bdeebef6
gh-122511: Improve documentation for object identity of mutable/immutable types (#122512)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-07 13:40:19 +00:00
Sam Gross 674a50ef2f
gh-117139: Fix an incorrect borrow in bytecodes.c (#122318)
`_PyDict_SetItem_Take2` steals both the key (i.e., `sub`) and the value.
2024-08-07 19:06:19 +05:30
Ali Hamdan 013a092975
gh-121151: argparse: Fix wrapping of long usage text of arguments inside a mutually exclusive groups (GH-121159) 2024-08-07 15:20:38 +02:00
pukkandan 9e551f9b35
gh-79846: Make ssl.create_default_context() ignore invalid certificates (GH-91740)
An error in one certificate should not cause the whole thing to fail.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-08-07 11:30:30 +03:00
Xie Yanbo b6c80e21c7
Fix typos in comments and docstring (#122720)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-08-07 07:39:16 +01:00
Barney Gale 98dba73010
GH-73991: Rework `pathlib.Path.rmtree()` into `delete()` (#122368)
Rename `pathlib.Path.rmtree()` to `delete()`, and add support for deleting
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `copy()` methods (which will also
accept any type of file.)
2024-08-07 01:34:44 +01:00
Jonathan Protzenko b5e142ba7c
gh-122571: Remove duplicate definition of PY_BUILTIN_HASHLIB_HASHES in configure.ac (#122572)
The redefinition in confdefs.h can cause issues with the
AX_CHECK_COMPILE_FLAG macro.
2024-08-06 23:31:39 +00:00
Victor Stinner 4767a6e31c
gh-122728: Fix SystemError in PyEval_GetLocals() (#122735)
Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
2024-08-06 23:01:44 +02:00
Pradyun Gedam 5b8a6c5186
gh-122744: Bump bundled pip to 24.2 (#122745)
Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2024-08-06 18:38:33 +00:00
Sam Gross dc09301067
gh-122417: Implement per-thread heap type refcounts (#122418)
The free-threaded build partially stores heap type reference counts in
distributed manner in per-thread arrays. This avoids reference count
contention when creating or destroying instances.

Co-authored-by: Ken Jin <kenjin@python.org>
2024-08-06 14:36:57 -04:00
Sam Gross 1429651a06
gh-121103: Update site module docs for free-threaded installs (#122737)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-08-06 14:34:34 -04:00
Виталий Дмитриев c4e8196940
Fix duplicated words 'begins with a' in pathlib docstring (#122732) 2024-08-06 18:38:33 +01:00
Nate Ohlson 58be1c270f
gh-112301: Add macOS warning tracking tooling (#122211)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-08-06 20:26:37 +03:00
Serhiy Storchaka 4b66b6b7d6
gh-120104: IDLE: Fix padding in config and search dialogs (#120107) 2024-08-06 12:45:53 -04:00
Mark Shannon 4c31791848
GH-120024: Move three more escaping calls out of conditional statements (GH-122734) 2024-08-06 14:14:52 +01:00
Kirill Podoprigora 8ce70d6c69
gh-122058: `Lib/inspect`: Update docstrings for `isfunction`, `isgenerator`, `isframe`, `iscode`. (#122059)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-08-06 14:47:31 +02:00
Sergey B Kirpichev 0b433aa9df
gh-122681: merge m_atan2() and c_atan2() helper functions (#122682) 2024-08-06 14:43:13 +02:00
Sergey B Kirpichev 6ff82fdb56
gh-122686: bump hypothesis from 6.104.2 to 6.108.10 in Tools (#122729)
This drops attrs pinning.
2024-08-06 14:37:07 +02:00
Mark Shannon fbfab4f88c
GH-120024: Refactor code generators to uses classes for emitting code. (GH-122730) 2024-08-06 13:04:33 +01:00
Lysandros Nikolaou ce0d66c8d2
gh-122581: Avoid data races when collecting parser statistics (#122694) 2024-08-06 13:29:57 +02:00
Mark Shannon a8be8fc6c4
GH-120024: Refactor code a bit so that escaping calls can be wrapped in spill code in code generator (GH-122693) 2024-08-06 08:40:39 +01:00
Jelle Zijlstra b72c748d7f
Fix syntax in generate_re_casefix.py (#122699)
This was broken in gh-97963.
2024-08-05 23:16:29 -07:00
Serhiy Storchaka e74680b718
gh-122595: Add more error checks in the compiler (GH-122596) 2024-08-06 08:59:44 +03:00
Kirill Podoprigora 94a4bd79a7
gh-122704: Fix reference leak in Modules/_pickle.c (GH-122705) 2024-08-06 08:57:36 +03:00
Malcolm Smith b0c48b8fd8
gh-116622: Android logging fixes (#122698)
Modifies the handling of stdout/stderr redirection on Android to accomodate 
the rate and buffer size limits imposed by Android's logging infrastructure.
2024-08-06 12:28:58 +08:00
Sergey B Kirpichev 35ae4aab1a
gh-122686: Pin attrs package (for Hypothesis workflow) (#122687)
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-08-06 06:56:50 +03:00
Miro Hrončok 44659d3927
GH-118943: Handle races when moving jit_stencils.h (GH-120690)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-05 16:10:40 -07:00
Mark Shannon 5bd72912a1
GH-122616: Simplify LOAD_ATTR_WITH_HINT and STORE_ATTR_WITH_HINT (GH-122620) 2024-08-05 16:27:48 +01:00
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