Commit graph

51691 commits

Author SHA1 Message Date
Miss Islington (bot)
def2ee1280
[3.12] Fix a typo in code module test (GH-130530) (GH-130533)
(cherry picked from commit 56e337d32b)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-02-25 09:54:15 +00:00
Miss Islington (bot)
8db2fa2575
[3.12] gh-130285: Fix handling of zero or empty counts in random.sample() (gh-130291) (gh-130417) 2025-02-21 17:48:46 +00:00
Miss Islington (bot)
dd5bf313c6
[3.12] gh-129363: Change regrtest sequential mode output (GH-129476) (#130406)
gh-129363: Change regrtest sequential mode output (GH-129476)

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c408f)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-21 14:16:27 +00:00
Miss Islington (bot)
6c4de3259d
[3.12] Fix outdated reference link in collections module (gh-130349) (gh-130387) 2025-02-21 00:15:48 +00:00
Hugo van Kemenade
ecfca20719
[3.12] gh-119727: Add --single-process option to regrtest (GH-119728) (#130359)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-02-20 15:47:10 +00:00
Sam Gross
60410f3c76
[3.12] gh-129269: Exclude everything in sys.path in test_coverage_ignore (gh-130133) (gh-130358)
The `test_trace.test_coverage_ignore` test would fail if you had
`setuptools` installed, such as in `~/.local/lib/python3.xxx/site-packages/`.
Ignore everything in `sys.path` when running the test.
(cherry picked from commit 35925e9529)
2025-02-20 15:37:43 +00:00
Miss Islington (bot)
e63ca56e3b
[3.12] gh-127750: Backport some tests for singledispatchmethod (GH-130309) (GH-130340) (GH-130341)
(cherry picked from commit 68c57d6f33)

(cherry picked from commit 395335d0ff)
(cherry picked from commit 10b32054ad)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-20 12:16:19 +00:00
Miss Islington (bot)
96a914ad7e
[3.12] gh-130250: use support.swap_attr() in test and don't assume we're beginning with a clean system state (GH-130342) (#130345)
gh-130250: use support.swap_attr() in test and don't assume we're beginning with a clean system state (GH-130342)
(cherry picked from commit 048ee2d5ec)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-02-20 11:45:42 +00:00
Miss Islington (bot)
b259b7577f
[3.12] gh-69001: Convert links to more usable buttons (GH-129591) (#130339)
gh-69001: Convert links to more usable buttons (GH-129591)

In Lib/idlelib/help_about.py, there are 2 links that are not underlined or colored, hence hard to tell that clicking works.  All buttons might get converted to colored and underlined links in the future.
---------
(cherry picked from commit ed831b95a2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-20 08:49:51 +00:00
Miss Islington (bot)
4fb2bb6edc
[3.12] gh-130250: fix cleanup in test (impacts refleaks runs) (GH-130329) (#130331)
gh-130250: fix cleanup in test (impacts refleaks runs) (GH-130329)
(cherry picked from commit c718c6be0f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-02-20 01:54:37 +00:00
Miss Islington (bot)
8d58070d7e
[3.12] gh-130250: fix regression in traceback.print_last (GH-130318) (#130326)
gh-130250: fix regression in traceback.print_last (GH-130318)
(cherry picked from commit 6c982aeb54)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-02-19 22:01:32 +00:00
Serhiy Storchaka
4a6415cbac
[3.12] gh-130230: Add new tests for 3-arg pow() with Decimal (GH-130237) (GH-130247)
(cherry picked from commit b93b7e566e)
2025-02-18 08:18:40 +00:00
Stan Ulbrych
8a598fb623
[3.12] gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130125)
We had the definition of what makes a character "printable" documented in three places, giving two different definitions.
The definition in the comment on `_PyUnicode_IsPrintable` was inverted; correct that.

With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database.  That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics.

Fix that by cutting the C API docs' and the C comment's copies of the subtle details, in favor of referring to the Python-level docs. That ensures it's explicit that these are all meant to agree, and also lets us concentrate improvements to the wording in one place.

Speaking of which, borrow some ideas from the C comment, along with other tweaks, to hopefully add a bit more clarity to that one newly-centralized copy in the docs.

Also add a thorough test that the implementation agrees with this definition.

Co-authored-by: Greg Price <gnprice@gmail.com>
(cherry picked from commit 3402e133ef)
2025-02-17 14:07:59 +01:00
Miss Islington (bot)
fc1c35f44d
[3.12] gh-130193: Increase test coverage of gettext.c2py (GH-130208) (GH-130218)
(cherry picked from commit fb2d325725)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-02-17 09:14:13 +00:00
Miss Islington (bot)
ad38c3c2b6
[3.12] gh-86069: Add more PyNumber_InPlacePower() tests (GH-130111) (GH-130212)
Test it with the third argument.
(cherry picked from commit cfe41037eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-17 10:25:20 +02:00
Miss Islington (bot)
042b49246b
[3.12] gh-118761: Revert "Improve import time of subprocess (GH-129427)" (GH-130201) (#130205)
gh-118761: Revert "Improve import time of `subprocess` (GH-129427)" (GH-130201)

* Revert "gh-118761: Improve import time of `subprocess` (GH-129427)"

This reverts commit 49f24650e4.
Also known as f502c8f6a6 in 3.13 (PR GH-129447)
Also known as f65aa0d1bf in 3.12 (PR GH-129448)

This caused bugs in the `__del__` finalizer:
 https://github.com/python/cpython/issues/118761#issuecomment-2661504264

---------
(cherry picked from commit ae30646089)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-02-16 18:56:18 +00:00
Miss Islington (bot)
4f09a85aca
[3.12] gh-130185: Fix unintentionally skipped tests in test_functools (GH-130186) (#130189)
gh-130185: Fix unintentionally skipped tests in `test_functools` (GH-130186)
(cherry picked from commit 73d03005b0)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-02-16 13:52:55 +00:00
Miss Islington (bot)
5e44d39ba1
[3.12] gh-127488: Add tests for Tools/i18n/msgfmt.py (GH-127540) (GH-130181)
(cherry picked from commit 361083b84b)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-02-16 13:14:50 +00:00
Miss Islington (bot)
b85f061b01
[3.12] gh-130177: Fix unintentionally skipped tests in test_gettext (GH-130178) (GH-130184)
(cherry picked from commit 2e8044a4f7)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-02-16 12:31:24 +00:00
Miss Islington (bot)
a122415c02
gh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)
(cherry picked from commit 303043f506)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2025-02-14 17:45:28 +00:00
Pablo Galindo Salgado
5e8a9eb13d
[3.12] gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer (GH-116049) (#130065)
(cherry picked from commit 56eda25633)
2025-02-13 01:42:24 +00:00
Tomas R.
96a6ee04b1
[3.12] gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module (GH-129855) (GH-130017)
(cherry picked from commit aa81a6f6e4)
2025-02-11 15:31:44 -08:00
Miss Islington (bot)
2db4a9d053
[3.12] gh-127712: Fix secure argument of logging.handlers.SMTPHandler (GH-127726) (GH-129956)
(cherry picked from commit d7672e5d5a)
2025-02-10 14:29:57 +00:00
Miss Islington (bot)
3d2ca741dc
[3.12] gh-126554: correct detection of gcc for TestNullDlsym.test_null_dlsym (GH-129872) (#129945)
gh-126554: correct detection of `gcc` for `TestNullDlsym.test_null_dlsym` (GH-129872)

In case gcc is not available, the test will fail with FileNotFoundError.
So catch the exception to skip the test correctly.
(cherry picked from commit 978211c8a8)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Co-authored-by: Peter Marko <peter.marko@siemens.com>
2025-02-10 10:08:18 +00:00
Miss Islington (bot)
774458884b
[3.12] gh-68400: Remove outdated 2.7 comment (GH-129919) (#129938)
(cherry picked from commit d9bf3c16e5)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-02-10 05:10:02 +00:00
Erlend E. Aasland
02e00a7373
[3.12] gh-129603: Don't segfault if sqlite3.Row description is None (#129604) (#129924)
(cherry picked from commit 7e6ee50b6b)
2025-02-10 00:14:40 +00:00
Miss Islington (bot)
23eccaebf3
[3.12] gh-129892: Doc: Remove unnecessary role directive in graphlib.py (GH-129896) (#129905)
gh-129892: Doc: Remove unnecessary role directive in graphlib.py (GH-129896)

Change `:exec:ValueError` to `ValueError` in `TopologicalSorter.done()` docstring
(cherry picked from commit c53730171f)

Co-authored-by: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com>
2025-02-09 15:39:23 +00:00
Miss Islington (bot)
fd8d445cb3
[3.12] gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859) (#129885)
gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859)

In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

(cherry picked from commit 6fbf15f98e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-09 04:19:55 -05:00
Terry Jan Reedy
550ec5cf35
[3.12] gh-129876: Initial 3.14 News3.txt entries (GH-129881) (#129883) 2025-02-09 07:32:52 +00:00
Miss Islington (bot)
a5e04513df
[3.12] gh-112953: Update news to finish 3.13 as main (GH-129877) (#129879)
Entry for patch to 3.13.rc3
(cherry picked from commit f72977b2f4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-09 06:30:46 +00:00
Miss Islington (bot)
5c527f8ddc
[3.12] gh-129699: Add description to IDLE doc title (GH-129727) (#129865)
gh-129699: Add description to IDLE doc title (GH-129727)

Also extend the 'idlelib' section header. These additions affect both the displayed idle.html file and the contents.html file displayed by clicking the Complete table of contents link on the main docs.python.org page. (The module index entries are generated from the module name and synopsis within module files.)
---------

(cherry picked from commit 33a7094aa6)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-08 19:42:43 +00:00
Miss Islington (bot)
1a0fbc7813
[3.12] gh-86206: Change IDLE splash line (GH-129698) (#129718)
Replace references to boilerplate files available in About IDLE and instead suggest clicking Help menu.

(cherry picked from commit d83a8a26f5)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-06 03:20:31 -05:00
Miss Islington (bot)
e7fb38186e
[3.12] gh-69001: Replace maintainer email in IDLE credits (GH-129588) (#129714)
Instead, anyone requesting credit should submit a PR with contribution summary.
(Also fix typo in existing name.)
(cherry picked from commit 76e0182948)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-02-06 07:03:21 +00:00
Miss Islington (bot)
62fafd867d
[3.12] gh-129660: Do not use test_embed in PGO profile builds (GH-129662) (#129685)
[3.13] gh-129660: Do not use test_embed in PGO profile builds (GH-129662)
(cherry picked from commit 19ceb342b5)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2025-02-05 11:39:58 +00:00
Thomas Wouters
8b0c113325 Merge branch '3.12' of https://github.com/python/cpython into 3.12 2025-02-04 20:39:37 +01:00
Miss Islington (bot)
0d207c3dd1
[3.12] gh-128772: Fix pydoc for methods with __module__ is None (GH-129177) (GH-129654)
(cherry picked from commit 979d766209)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-04 14:44:02 +00:00
Miss Islington (bot)
676ee57bd6
[3.12] gh-129350: Make tests for glob with trailing slash more strict (GH-129376) (GH-129652)
Test that the trailing pathname separator is preserved.

Multiple trailing pathname separators are only preserved if the pattern
does not contain metacharacters, otherwise only one trailing pathname
separator is preserved. This is rather an implementation detail.
(cherry picked from commit 8b5c8508c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-04 14:42:14 +00:00
Thomas Wouters
fdb81425a9 Python 3.12.9 2025-02-04 15:38:38 +01:00
Miss Islington (bot)
e4384d1544
[3.12] gh-128696: Add arm64 to the get_platform return val description (GH-128701) (#128773)
gh-128696: Add arm64 to the get_platform return val description (GH-128701)
(cherry picked from commit 553cdc6d68)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2025-02-04 00:29:16 +01:00
Miss Islington (bot)
64396fb124
[3.12] gh-128078: Use PyErr_SetRaisedException in _PyGen_SetStopIterationValue (GH-128287) (#128790)
gh-128078: Use `PyErr_SetRaisedException` in `_PyGen_SetStopIterationValue` (GH-128287)
(cherry picked from commit 402b91da87)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-02-04 00:28:14 +01:00
Miss Islington (bot)
97097469c7
[3.12] gh-127975: Avoid reusing quote types in ast.unparse if not needed (GH-127980) (#129601)
gh-127975: Avoid reusing quote types in ast.unparse if not needed (GH-127980)
(cherry picked from commit 8df5193d37)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2025-02-02 22:58:22 +00:00
Miss Islington (bot)
e20963a12a
[3.12] gh-115514: Fix incomplete writes after close while using ssl in asyncio(GH-128037) (#129582)
gh-115514: Fix incomplete writes after close while using ssl in asyncio(GH-128037)

(cherry picked from commit 4e38eeafe2)

Co-authored-by: Vojtěch Boček <vbocek@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-02-02 15:47:37 +00:00
Miss Islington (bot)
a7084f6075
[3.12] gh-105704: Disallow square brackets ([ and ]) in domain names for parsed URLs (GH-129418) (GH-129527)
gh-105704: Disallow square brackets (`[` and `]`) in domain names for parsed URLs (GH-129418)

* gh-105704: Disallow square brackets ( and ) in domain names for parsed URLs

* Use Sphinx references



* Add mismatched bracket test cases, fix news format

* Add more test coverage for ports

---------

(cherry picked from commit d89a5f6a6e)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-02-02 08:30:28 +00:00
Miss Islington (bot)
368ba55819
[3.12] gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465 (GH-129561) (#129565)
gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465 (GH-129561)

Restore the skipUnless removed by GH-119465.

This test can only pass on virtual machines, not actual machines.

actual machines see:

```
    self.cli.connect((cid, VSOCKPORT))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 19] No such device
```

Reproduced on (Linux) Ubuntu 24.04.1 running 6.8.0-52-generic.
(cherry picked from commit e1006ce1de)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-02 05:04:45 +00:00
Victor Stinner
48f08fe6c8
[3.12] gh-111495: Add PyFile tests (#129449) (#129477) (#129501)
[3.13] gh-111495: Add PyFile tests (#129449) (#129477)

gh-111495: Add PyFile tests (#129449)

Add tests for the following functions in test_capi.test_file:

* PyFile_FromFd()
* PyFile_GetLine()
* PyFile_NewStdPrinter()
* PyFile_WriteObject()
* PyFile_WriteString()
* PyObject_AsFileDescriptor()

Remove test_embed.StdPrinterTests which became redundant.

(cherry picked from commit 4ca9fc08f8)
(cherry picked from commit 9a59a51733)
2025-01-31 10:27:35 +01:00
Irit Katriel
d2f551db12
[3.12] gh-128799: Add frame of except* to traceback when wrapping a naked exception (GH-128971) (#129328) 2025-01-30 12:02:46 +00:00
Miss Islington (bot)
ddb314f598
[3.12] remove type annotations from multiprocessing. (GH-129381) (#129471)
remove type annotations from multiprocessing. (GH-129381)

* remove type annotations from multiprocessing.

One of them was technically invalid per typing specs... but since we're not
checking these in the stdlib today lets elide them.

https://discuss.python.org/t/static-type-annotations-in-cpython/65068/13

* use the actual comment style annotation format



---------
(cherry picked from commit 71aecc284e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2025-01-30 09:08:31 +00:00
Miss Islington (bot)
f463d05a09
[3.12] gh-129403: Fix ValueError messages in asyncio.Barrier and threading.Barrier (GH-129419) (#129469)
gh-129403: Fix `ValueError` messages in `asyncio.Barrier` and `threading.Barrier` (GH-129419)
(cherry picked from commit bcb25d60b1)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-30 08:28:06 +00:00
Miss Islington (bot)
c0ae83af95
[3.12] gh-125522: Fix bare except in test_uuid (GH-129018) (#129456)
gh-125522: Fix bare except in `test_uuid` (GH-129018)
(cherry picked from commit a1a4e9f39a)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-29 21:16:47 +00:00
Miss Islington (bot)
f65aa0d1bf
[3.12] gh-118761: Improve import time of subprocess (GH-129427) (#129448)
gh-118761: Improve import time of `subprocess` (GH-129427)

* subprocess: lazy import signal and locale to improve module import time
(cherry picked from commit 49f24650e4)

Co-authored-by: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
2025-01-29 16:48:48 +00:00