Commit Graph

116042 Commits

Author SHA1 Message Date
Miss Islington (bot) 533da5ed67
[3.11] gh-111811: Fix test_recursive_repr for WASI (GH-112130) (#112132)
gh-111811: Fix test_recursive_repr for WASI (GH-112130)
(cherry picked from commit 7218bac8c8)

Co-authored-by: Kushal Das <mail@kushaldas.in>
2023-11-16 18:10:02 +01:00
Miss Islington (bot) b4f3a62383
[3.11] gh-110812: Isolating Extension Modules HOWTO: List GC-related gotchas (GH-111504) (GH-112147)
gh-110812: Isolating Extension Modules HOWTO: List GC-related gotchas (GH-111504)
(cherry picked from commit 985679f05d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-11-16 13:34:21 +01:00
Petr Viktorin 132a74922a
[3.11] gh-102837: more tests for the math module (GH-111930)(GH-102523) (GH-112030) (GH-112041)
[3.12] gh-102837: more tests for the math module (GH-111930)(GH-102523) (GH-112030)

* gh-102837: improve test coverage for math module (GH-102523)

(Only the test changes from GH-102523 are cherry-picked)

- input checks for math_1(L989), math_1a(L1023), math_2(L1064,L1071), hypot(L2682), log(L2307), ldexp(L2168), ceil(L1165), floor(L1236,L1239) and dist(L2587,L2588,L2628).
- improve fsum coverage for exceptional cases (L1433,L1438,L1451,L1497), ditto fmod(L2378)

(all line numbers are wrt the main branch at 5e6661bce9)

* gh-102837: more tests for the math module (GH-111930)

Add tests to improve coverage:

* fsum: L1369, L1379, L1383, L1412
* trunc: L2081
* log: L2267
* dist: L2577, L2579
* hypot: L2632
* (not cherry-picked for 3.11: sumprod)
* pow: L2982
* prod: L3294, L3308, L3318-3330

// line numbers wrt to 9dc4fb8204

(cherry picked from commit c61de456db)

---------

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
(cherry picked from commit c6aea46a71)
2023-11-16 13:07:53 +01:00
Hugo van Kemenade cdfef0c383
[3.11] gh-111062: CI: Move OS test jobs to reusable workflows (gh-111570)
CI: Move OS test jobs to reusable workflows

Co-authored-by: Donghee Na <donghee.na@python.org>
2023-11-16 00:39:30 +00:00
Miss Islington (bot) e2421a36f0
[3.11] gh-111942: Fix crashes in TextIOWrapper.reconfigure() (GH-111976) (GH-112059)
* Fix crash when encoding is not string or None.
* Fix crash when both line_buffering and write_through raise exception
  when converted ti int.
* Add a number of tests for constructor and reconfigure() method
  with invalid arguments.

(cherry picked from commit ee06fffd38)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-15 14:20:18 +00:00
Miss Islington (bot) a92b9e5b2b
[3.11] Docs: Add the time to the HTML last updated format (GH-110091) (#112103)
Docs: Add the time to the HTML last updated format (GH-110091)
(cherry picked from commit 6c214dea7c)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-11-15 06:20:17 +01:00
Miss Islington (bot) e73216d32b
[3.11] gh-110944: Move pty helper to test.support and add basic pdb completion test (GH-111826) (GH-112025)
gh-110944: Move pty helper to test.support and add basic pdb completion test (GH-111826)
(cherry picked from commit 1c7ed7e9eb)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-11-14 13:25:38 +01:00
Miss Islington (bot) 46081fe9b5
[3.11] gh-112007: Re-organize help utility intro message (GH-112017) (#112048)
gh-112007: Re-organize help utility intro message (GH-112017)

Most important: move how-to-quit sentence to the end and mention 'q'.
Re-group the other sentences and improve some wording.
---------

(cherry picked from commit b28bb130bb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-13 19:50:56 +00:00
Alex Waygood 4baf633c53
[3.11] gh-111681: minor fix to a typing doctest (#111682) (#112037) 2023-11-13 14:01:17 +00:00
Hugo van Kemenade d4217e5db5
[3.11] Docs: Add `make htmllive` to rebuild and reload HTML files in your browser (GH-111900) (#112023)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-13 08:58:43 +00:00
Miss Islington (bot) b64afbc55c
[3.11] gh-111944: Add assignment expression parentheses requirements (GH-111977) (#112011)
Augment the list of places where parentheses are
required around assignnment statements.  In particular,
'a := 0' and 'a = b := 1' are syntax errors.
(cherry picked from commit 9a2f25d374)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-13 00:14:03 +00:00
Victor Stinner aa3232db23
[3.11] gh-111929: Fix regrtest clear_caches() (#111949)
gh-111929: Fix regrtest clear_caches()

Python 3.11 doesn't have the fractions._hash_algorithm.cache_clear()
function.
2023-11-13 00:00:38 +01:00
Miss Islington (bot) 9536fe1656
[3.11] gh-112001: Fix test_builtins_have_signatures in test_inspect (GH-112002) (GH-112004)
(cherry picked from commit 40752c1c1e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-12 14:49:59 +02:00
Miss Islington (bot) 5a6d1dbc10
[3.11] Fix undefined behaviour in datetime.time.fromisoformat() (GH-111982) (#111991)
Fix undefined behaviour in datetime.time.fromisoformat() (GH-111982)

Fix undefined behaviour in datetime.time.fromisoformat() when parsing a string without a timezone. 'tzoffset' is not assigned to by parse_isoformat_time if it returns 0, but time_fromisoformat then passes tzoffset to another function, which is undefined behaviour (even if the function in question does not use the value).
(cherry picked from commit 21615f77b5)

Co-authored-by: T. Wouters <thomas@python.org>
2023-11-12 00:24:02 +00:00
Miss Islington (bot) cd3e2d3a6c
[3.11] gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL on Windows (GH-111842) (GH-111967)
(cherry picked from commit 0b06d2482d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-11 11:17:29 +02:00
Miss Islington (bot) 7b55a955bc
[3.11] gh-111251: Fix error checking in _blake2 module init (GH-111252) (#111298)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-10 14:43:51 +00:00
Miss Islington (bot) e433785e48
[3.11] gh-111912: Run test_posix on Windows (GH-111913) (GH-111954)
(cherry picked from commit 64fea3211d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-10 16:12:24 +02:00
Miss Islington (bot) 8222ad01fe
[3.11] [3.12] gh-109181: Fix refleak in tb_get_lineno() (GH-111948) (#111951)
[3.12] gh-109181: Fix refleak in tb_get_lineno() (GH-111948)

PyFrame_GetCode() returns a strong reference.
(cherry picked from commit 4b0c875d91)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-10 13:32:02 +00:00
Miss Islington (bot) 7b8445109d
[3.11] gh-108303: Install `Lib/test/configdata` (GH-111899) (#111945)
gh-108303: Install `Lib/test/configdata` (GH-111899)
(cherry picked from commit 65d6dc2715)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-10 12:23:57 +00:00
Miss Islington (bot) ecc8df2ee0
[3.11] gh-111929: Fix regrtest --pgo: test_str => test_unicode (GH-111938) (#111940)
gh-111929: Fix regrtest --pgo: test_str => test_unicode (GH-111938)

test_unicode was renamed to test_str in Python 3.13, but Python 3.12
still uses test_unicode name.
(cherry picked from commit 5f42a2bc40)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-10 09:54:38 +00:00
Miss Islington (bot) 0e45786a6a
gh-111356: io: Add missing documented objects to io.__all__ (GH-111370)
Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb7718f8)

Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
2023-11-10 07:32:41 +00:00
Brett Cannon 226f4bc692
[3.11] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-111920)
GH-111804: Drop posix.fallocate() under WASI (GH-111869)

Drop posix.fallocate() under WASI.

The underlying POSIX function, posix_fallocate(), was found to vary too
much between implementations to remain in WASI. As such, while it was
available in WASI preview1, it's been dropped in preview2.
2023-11-09 15:36:15 -08:00
Vinay Sajip 078cdccc2a
[3.11] gh-110875: Handle '.' properties in logging formatter configuration correctly. (GH-110943) (GH-111914)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2023-11-09 19:51:43 +00:00
Miss Islington (bot) 316221c23f
[3.11] gh-111895: Convert definition list to bullet list for readability on mobile (GH-111898) (#111909)
gh-111895: Convert definition list to bullet list for readability on mobile (GH-111898)

Convert definition list to bullet list for readability on mobile
(cherry picked from commit 7d21e3d5ee)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-09 21:13:43 +02:00
Victor Stinner f108976ebb
[3.11] gh-111881: Use lazy import in test.support (#111885) (#111890) (#111902)
[3.12] gh-111881: Use lazy import in test.support (#111885) (#111890)

gh-111881: Use lazy import in test.support (#111885)

* Import lazily getpass in test.support

Backport to 3.11: test.support.os_helper is unchanged.

(cherry picked from commit 0372e3b02a)
(cherry picked from commit e983ca859d)
2023-11-09 16:46:27 +00:00
Miss Islington (bot) 63205e5692
[3.11] gh-111881: Import doctest lazily in libregrtest (GH-111884) (#111894)
gh-111881: Import doctest lazily in libregrtest (GH-111884)

In most cases, doctest is not needed. So don't always import it at
startup. The change reduces the number of modules already
imported when a test is run.
(cherry picked from commit 6f09f69b7f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-09 15:37:04 +00:00
Miss Islington (bot) 3e7e39c977
[3.11] gh-108303: Move more files to `Lib/test/test_module` (GH-111880) (#111892)
gh-108303: Move more files to `Lib/test/test_module` (GH-111880)
(cherry picked from commit 0c42f7304a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-09 15:10:26 +00:00
Miss Islington (bot) 409a0ac8e5
[3.11] gh-108303: Move config parser data to `Lib/test/configparserdata/` (gh-111879) (gh-111883)
gh-108303: Move config parser data to `Lib/test/configparserdata/` (gh-111879)
(cherry picked from commit cc18b886a5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-09 15:43:28 +01:00
Nikita Sobolev a60bbdee3a
[3.11] gh-108303: Move more typing related files to Lib/test/typinganndata (GH-111825) (#111860) 2023-11-08 17:19:47 +00:00
Miss Islington (bot) 45f17a165b
[3.11] Glossary: Add "static type checker" (GH-111837) (#111855)
Glossary: Add "static type checker" (GH-111837)
(cherry picked from commit 8ab7ad6308)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-08 14:47:54 +00:00
Miss Islington (bot) 942ef7bde4
[3.11] gh-111806: Fix `test_recursion` in `test_richcmp` on WASI builds (GH-111830) (GH-111832)
gh-111806: Fix `test_recursion` in `test_richcmp` on WASI builds (GH-111830)
(cherry picked from commit f115a55f0e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-07 22:04:18 +00:00
Ethan Furman 4edf25565f
[3.11] gh-111797: fix enum how-to (GH-111805)
remove extra error line in how-to
2023-11-06 18:57:10 -08:00
Donghee Na bd4cc4715f
[3.11] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 co… (gh-111771)
[3.11] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds (gh-111695)
(cherry picked from commit c8faa3568a)

Co-authored-by: Masayuki Moriyama <masayuki.moriyama@miraclelinux.com>
2023-11-06 11:29:59 +00:00
Miss Islington (bot) 9fe9eaec2d
[3.11] gh-111747: DOC: fix moved link to Documentation Translations (GH-111748) (#111750)
Update old link in bugs.rst to the table of doc translators and translation repositories at Github.
(cherry picked from commit 72e27a67b9)

Co-authored-by: partev <petrosyan@gmail.com>
2023-11-05 04:28:48 +00:00
Miss Islington (bot) cebf2d2a5d
[3.11] gh-111724: Fix doctest `ResourceWarning` in `howto/descriptor.rst` (GH-111725) (#111728)
gh-111724: Fix doctest `ResourceWarning` in `howto/descriptor.rst` (GH-111725)

Close database connection explicitly in test cleanup.
(cherry picked from commit f48e669504)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-04 15:56:08 -04:00
Miss Islington (bot) 425efc1182
[3.11] gh-111159: Fix `SyntaxError` doctests for non-builtin exception classes (GH-111541) (#111733)
gh-111159: Fix `SyntaxError` doctests for non-builtin exception classes (GH-111541)
(cherry picked from commit 18c954849b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-04 10:12:15 +00:00
Miss Islington (bot) f7ffe4a8ea
[3.11] [3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (GH-111632) (#111634)
* [3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (GH-111632)
(cherry picked from commit 9aa88290d8)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it..
(cherry picked from commit 229f44d353)

* gh-111644: Fix asyncio test_unhandled_exceptions() (#111713)

Fix test_unhandled_exceptions() of test_asyncio.test_streams: break
explicitly a reference cycle.

Fix also StreamTests.tearDown(): the loop must not be closed
explicitly, but using set_event_loop() which takes care of shutting
down the executor with executor.shutdown(wait=True).
BaseEventLoop.close() calls executor.shutdown(wait=False).

(cherry picked from commit ac01e2243a)

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-04 01:23:01 +00:00
Miss Islington (bot) 89264a31ea
[3.11] gh-111644: Fix support threading_cleanup() (GH-111714) (#111717)
gh-111644: Fix support threading_cleanup() (GH-111714)

Copy the list of dangling threads to make sure that the list of
"Dangling thread" is complete. Previously, the list was incomplete if
threads completed just before the list was displayed.

Changes:

* Rewrite the warning to make it easier to understand.
* Use support.sleeping_retry().
* threading_cleanup() no longer copies threading._dangling,
  but only counts the number of dangling thread.
* Remove support.gc_support() call.
(cherry picked from commit f62c7ccf9a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-04 00:43:53 +00:00
Ethan Furman 4a61169672
[3.11] gh-111181: Fix enum doctests (GH-111180) (GH-111617)
gh-111181: Fix enum doctests (GH-111180)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
(cherry picked from commit c4dc5a6ae8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-03 16:51:56 -07:00
Miss Islington (bot) a106f61b72
[3.11] gh-54434: Make difflib.rst doctests pass. (GH-111677) (#111679)
gh-54434: Make difflib.rst doctests pass. (GH-111677)
(cherry picked from commit 0d3df272fb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-03 06:28:53 +00:00
Miss Islington (bot) e61f2edfe8
[3.11] Fix typo in documentation of `SysLogHandler.createSocket` (GH-111665) (#111670)
(cherry picked from commit 489b80640f)
2023-11-02 23:03:02 +00:00
Miss Islington (bot) cfdcc96aba
[3.11] gh-111625: Fix link to Info-ZIP homepage (GH-111626) (#111640)
Co-authored-by: partev <petrosyan@gmail.com>
2023-11-02 11:36:35 +00:00
Miss Islington (bot) cf6145453f
[3.11] gh-111576: Improve documention for tkinter.messagebox (GH-111578) (GH-111598)
(cherry picked from commit eaf67e37a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-01 12:43:37 +02:00
Miss Islington (bot) 1d7ad7780a
[3.11] gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (GH-111577) (#111590)
gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (GH-111577)

"./python -m test -j1 -R 3:3 --verbose3" now works as expected, since
run_single_test() does not replace sys.stdout with StringIO in this
case.
(cherry picked from commit d9a5530d23)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-01 03:57:23 +00:00
Miss Islington (bot) 2bb10acfdd
[3.11] gh-102249: Expand sys.call_tracing documentation (GH-102806) (#111558)
Co-authored-by: Quentin Peter <impact27@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-10-31 18:40:17 +02:00
Miss Islington (bot) 650eb29b49
[3.11] gh-93607: document `root` attribute of `iterparse` (GH-99410) (#111556)
Co-authored-by: Prometheus3375 <35541026+Prometheus3375@users.noreply.github.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-31 16:24:41 +00:00
Miss Islington (bot) be21fb6369
[3.11] gh-106861: Docs: Add availability directives to all Unix-only modules (GH-108975) (#111554)
Co-authored-by: xzmeng <aumo@foxmail.com>
2023-10-31 16:24:17 +00:00
Pablo Galindo Salgado a4aa213b65
[3.11] gh-109181: Speed up Traceback object creation by lazily compute the line number (GH-111548) (#111550)
.
(cherry picked from commit abb15420c1)
2023-10-31 15:59:31 +00:00
Pablo Galindo Salgado 19a266ca89
[3.11] gh-111366: Correctly show custom syntax error messages in the codeop module functions (GH-111384). (#111516)
(cherry picked from commit cd6e0a04a1)
2023-10-31 14:41:20 +00:00
Nikita Sobolev bc9f47097e
[3.11] gh-108303: Move all inspect test files to `test_inspect/` (GH-109607) (#111543) 2023-10-31 14:00:39 +00:00