Commit Graph

123254 Commits

Author SHA1 Message Date
Sam Gross 736fe4d23e
gh-117139: Fix a few `_PyStackRef` related bugs (#122831)
`BUILD_SET` should use a borrow instead of a steal. The cleanup in `_DO_CALL`
`CONVERSION_FAILED` was incorrect.

Co-authored-by: Ken Jin <kenjin@python.org>
2024-08-12 14:49:33 -04:00
Damien be90648fb2
gh-122944: Fix incorrect prompt strings in the Python Tutorial (#122949)
In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.
2024-08-12 14:30:08 -04:00
Mark Shannon 1795d6ceba
GH-122869: Add missing tier two optimizer cases (GH-122936) 2024-08-12 10:35:52 -07:00
Jelle Zijlstra 53ebb6232a
gh-122888: Fix crash on certain calls to str() (#122889)
Fixes #122888
2024-08-12 09:20:09 -07:00
sobolevn 7c22ab5b38
Fix old-style `print` statement in `gettext` comments (#122939) 2024-08-12 18:15:57 +03:00
Serhiy Storchaka f9ba1f35c7
gh-122688: Add more tests for var-positional parameters in Argument Clinic (GH-122900) 2024-08-12 16:52:48 +03:00
Xie Yanbo 253c6a0b2f
Fix typos in comments and test code (#122846) 2024-08-11 21:16:41 -07:00
Victor Stinner 9375b9ca3a
Remove "print >>obj" exception hint for Python 2 (#122853) 2024-08-12 04:12:14 +00:00
Jason R. Coombs 6aa35f3002
gh-122903: Honor directories in zipfile.Path.glob. (#122908) 2024-08-11 20:33:33 -04:00
Jason R. Coombs 9cd0326310
gh-122905: Sanitize names in zipfile.Path. (#122906)
Ported from zipp 3.19.1; ref jaraco/zipp#119.
2024-08-11 19:48:50 -04:00
Jelle Zijlstra 4534068f22
gh-119180: annotationlib: Fix __all__, formatting (#122365) 2024-08-11 23:44:51 +00:00
Jelle Zijlstra 016f4b5975
gh-119180: Improvements to ForwardRef.evaluate (#122210)
Noticed some issues while writing documentation for this method.
2024-08-11 23:42:57 +00:00
Barney Gale a6644d4464
GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)
Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.)

Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `delete()` methods (which will also
accept any type of file.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 22:43:18 +01:00
sobolevn ea70439bd2
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (#122702)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 21:02:50 +00:00
Rafael Fontenelle db8b83c2b0
Docs: Standardise versionchanged text in weakref.rst (#122898) 2024-08-11 21:40:11 +01:00
Sam Gross 1069190bad
gh-122860: Remove unused macro `_Py_atomic_load_relaxed_int32` (#122861) 2024-08-11 22:45:02 +05:30
Wulian bc9d92c679
gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-11 16:35:51 +00:00
Kumar Aditya 3aaed083a3
GH-120974: make `_asyncio.all_tasks` thread safe (#122801)
Make `_asyncio.all_tasks` thread safe, also changes state lock to use critical section.
2024-08-11 20:49:31 +05:30
Barney Gale 363374cf69
GH-120794: Use example paths with multiple parts in pathlib docs (#122887)
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-10 21:21:17 +00:00
Adam Turner 0959142e4d
gh-122868: Add more lower bounds for sphinxcontrib dependencies (#122891) 2024-08-10 20:50:43 +00:00
Nico Mexis 5580f31c56
gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-10 20:16:34 +01:00
Adam Turner 0fd97e46c7
gh-122868: Add lower bounds for sphinxcontrib dependencies (#122870)
* Docs: Add lower bounds for sphinxcontrib dependencies

* oops
2024-08-10 01:18:46 +03:00
Victor Stinner d3239976a8
gh-105376: Restore deprecated logging warn() method (#122775)
This reverts commit dcc028d924 and
commit 6c54e5d721.

Keep the deprecated logging warn() method in Python 3.13.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-09 15:13:24 +02:00
Victor Stinner b4a316087c
gh-111495: Fix refleaks in test_capi.test_eval tests (#122851) 2024-08-09 09:47:00 +00:00
Serhiy Storchaka 8393608dd9
gh-122688: Fix support of var-positional parameter in Argument Clinic (GH-122689)
* Parameters after the var-positional parameter are now keyword-only
  instead of positional-or-keyword.
* Correctly calculate min_kw_only.
* Raise errors for invalid combinations of the var-positional parameter
  with "*", "/" and deprecation markers.
2024-08-09 09:22:41 +00:00
Sergey B Kirpichev b6e745a27e
gh-121268: Remove workarounds for non-IEEE 754 systems in cmath (#122716)
As now building Python now requires support of IEEE 754 floating point
numbers.
2024-08-09 11:17:40 +02:00
Malcolm Smith 2f5c3b09e4
gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)
(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
2024-08-09 00:00:55 +02:00
Miro Hrončok 8c9d1742de
GH-118943: Remove regen-jit from the regen-all make target (GH-122602)
Co-authored-by: Éric <merwok@netwok.org>
2024-08-08 13:34:42 -07:00
Nate Ohlson aab18f4d92
gh-112301: Update documentation for configure options (``--disable-safety`` and ``--enable-slower-safety``) (#122758)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-08 20:35:00 +01:00
Kirill Podoprigora 2037d8cbae
gh-122835: Fix module name in ``test_typing`` (#122836) 2024-08-08 19:26:31 +00:00
Sam Gross 2d9d3a9f53
gh-122697: Fix free-threading memory leaks at shutdown (#122703)
We were not properly accounting for interpreter memory leaks at
shutdown and had two sources of leaks:

 * Objects that use deferred reference counting and were reachable via
   static types outlive the final GC. We now disable deferred reference
   counting on all objects if we are calling the GC due to interpreter
   shutdown.

 * `_PyMem_FreeDelayed` did not properly check for interpreter shutdown
   so we had some memory blocks that were enqueued to be freed, but
   never actually freed.

 * `_PyType_FinalizeIdPool` wasn't called at interpreter shutdown.
2024-08-08 12:48:17 -04:00
Irit Katriel 833eb106f5
gh-122562: fix dump_symtable for ste_free and ste_child_free removal (#122825) 2024-08-08 14:03:45 +01:00
Victor Stinner bf8b374639
gh-111495: Add more tests on PyEval C APIs (#122789)
* Add Lib/test/test_capi/test_eval.py
* Add Modules/_testlimitedcapi/eval.c
2024-08-08 14:16:20 +02:00
Mark Shannon 81c739e2dc
GH-120024: Tidy up case generator code a bit. (GH-122780) 2024-08-08 10:57:59 +01:00
Petr Viktorin 0d9c123d1a
gh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776) 2024-08-08 11:20:58 +02:00
Francisco Kurucz acf0d9eae6
InternalDocs: Fix typo in link to instruction_sequence.c inside compiler docs (#122809) 2024-08-08 09:19:10 +01:00
Serhiy Storchaka fe13c9baf4
gh-122255: Add black box tests in test_warnings (GH-122227)
They are similar to white box tests for gh-86298 in test_importlib.
2024-08-08 10:35:47 +03:00
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