Commit graph

118255 commits

Author SHA1 Message Date
Miss Islington (bot)
dfdbfc548f
gh-111856: Fix os.fstat on windows with FAT32 and exFAT filesystem (GH-112038)
(cherry picked from commit 29af7369db)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2023-11-13 16:25:01 +00:00
Petr Viktorin
c6aea46a71
[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
* sumprod: L2744, L2754, L2774, L2778, L2781, L2785, L2831, L2835, L2838
* 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>
2023-11-13 15:54:40 +01:00
Alex Waygood
9aa5ff82d4
[3.12] gh-111681: minor fixes to typing doctests; remove unused imports in test_typing (#111682) (#112035)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-13 14:08:57 +00:00
Alex Waygood
7313bde84c
[3.12] Bump mypy to 1.7.0 (GH-111961) (#112033) 2023-11-13 13:59:56 +00:00
Miss Islington (bot)
a1447af69c
[3.12] Docs: Add make htmllive to rebuild and reload HTML files in your browser (GH-111900) (#112022)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-13 10:15:11 +02:00
Miss Islington (bot)
3b7e308a24
[3.12] gh-111944: Add assignment expression parentheses requirements (GH-111977) (#112010)
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:17:54 +00:00
Miss Islington (bot)
378a96e361
[3.12] gh-112001: Fix test_builtins_have_signatures in test_inspect (GH-112002) (GH-112003)
(cherry picked from commit 40752c1c1e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-12 13:20:36 +00:00
Miss Islington (bot)
158a7e1acd
[3.12] gh-111933: fix broken link to A.Neumaier article (gh-111937) (gh-111993) 2023-11-12 01:22:44 +00:00
Miss Islington (bot)
13ca1f02a4
[3.12] gh-111777: Fix assertion errors on incorrectly still-tracked GC object destruction (GH-111778) (#111989)
gh-111777: Fix assertion errors on incorrectly still-tracked GC object destruction (GH-111778)

In PyObject_GC_Del, in Py_DEBUG mode, when warning about GC objects that
were not properly untracked before starting destruction, take care to
untrack the object _before_ warning, to avoid triggering a GC run and
causing the problem the code tries to warn about. Also make sure to save and
restore any pending exceptions, which the warning would otherwise clobber or
trigger an assertion error on.
(cherry picked from commit ce6a533c4b)

Co-authored-by: T. Wouters <thomas@python.org>
2023-11-12 00:44:24 +00:00
Miss Islington (bot)
1afc4dc3e6
[3.12] Fix undefined behaviour in datetime.time.fromisoformat() (GH-111982) (#111992)
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:39:03 +00:00
Gregory P. Smith
0f7671cc69
[3.12] gh-110395: invalidate open kqueues after fork (GH-110517) (#111745)
* [3.12] gh-110395: invalidate open kqueues after fork (GH-110517)

Invalidate open select.kqueue instances after fork as the fd will be invalid in the child.
(cherry picked from commit a6c1c04d4d)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>

* move assert to after the child dying

this is in `main` via https://github.com/python/cpython/pull/111816/files
2023-11-11 09:21:52 -08:00
Miss Islington (bot)
3bd8b74330
[3.12] gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL on Windows (GH-111842) (GH-111966)
(cherry picked from commit 0b06d2482d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-11 08:02:08 +00:00
Miss Islington (bot)
2c6000cba4
[3.12] gh-111251: Fix error checking in _blake2 module init (GH-111252) (#111297)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-10 14:58:00 +00:00
Miss Islington (bot)
41b2d8c7fa
[3.12] gh-111912: Run test_posix on Windows (GH-111913) (GH-111953)
(cherry picked from commit 64fea3211d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-10 16:12:39 +02:00
Miss Islington (bot)
37804149ec
[3.12] gh-103791: handle BaseExceptionGroup in contextlib.suppress() (GH-111910) (#111955)
gh-103791: handle `BaseExceptionGroup` in `contextlib.suppress()` (GH-111910)
(cherry picked from commit d61313bdb1)

Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
2023-11-10 14:00:48 +00:00
Victor Stinner
4b0c875d91
[3.12] gh-109181: Fix refleak in tb_get_lineno() (#111948)
PyFrame_GetCode() returns a strong reference.
2023-11-10 14:07:45 +01:00
Miss Islington (bot)
881c9eb962
[3.12] gh-108303: Install Lib/test/configdata (GH-111899) (#111946)
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:32:21 +00:00
Victor Stinner
5f42a2bc40
gh-111929: Fix regrtest --pgo: test_str => test_unicode (#111938)
test_unicode was renamed to test_str in Python 3.13, but Python 3.12
still uses test_unicode name.
2023-11-10 09:32:06 +00:00
Miss Islington (bot)
95141aa715
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:37:19 +00:00
Serhiy Storchaka
4018209fff
[3.12] gh-109370: Fix unexpected traceback output in test_concurrent_futures (GH-109780) (GH-111934)
Follow-up of gh-107219.

* Only close the connection writer on Windows.
* Also use existing constant _winapi.ERROR_OPERATION_ABORTED instead of
  WSA_OPERATION_ABORTED.
(cherry picked from commit 0b4e090422)
2023-11-10 07:17:02 +00:00
Brett Cannon
5a8e6f8bcc
[3.12] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-111919)
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:35:51 -08:00
Miss Islington (bot)
09df271965
[3.12] gh-110875: Handle '.' properties in logging formatter configuration c… (GH-110943) (GH-111911)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2023-11-09 19:34:10 +00:00
Miss Islington (bot)
fe7631e558
[3.12] gh-111895: Convert definition list to bullet list for readability on mobile (GH-111898) (#111908)
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:23 +02:00
Miss Islington (bot)
5089faf954
[3.12] gh-111881: Import doctest lazily in libregrtest (GH-111884) (#111893)
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:40:10 +00:00
Victor Stinner
e983ca859d
[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
* Only import ctypes on Windows in test.support.os_helper.

(cherry picked from commit 0372e3b02a)
2023-11-09 15:23:58 +00:00
Miss Islington (bot)
e0d827d479
[3.12] gh-108303: Move more files to Lib/test/test_module (GH-111880) (#111891)
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:21:24 +00:00
Miss Islington (bot)
e11ea5a400
[3.12] gh-108303: Move config parser data to Lib/test/configparserdata/ (gh-111879) (gh-111882)
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:41:44 +01:00
Miss Islington (bot)
4f976c3b9a
[3.12] gh-110543: Fix CodeType.replace in presence of comprehensions (GH-110586) (#111866)
gh-110543: Fix CodeType.replace in presence of comprehensions (GH-110586)
(cherry picked from commit 0b718e6407)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-11-08 20:48:18 +00:00
Miss Islington (bot)
759168a2a9
[3.12] gh-111495: Add tests for PyList C API (GH-111562) (GH-111861)
(cherry picked from commit a3903c8ec8)

Signed-off-by: kalyanr <kalyan.ben10@live.com>
Co-authored-by: Kalyan <kalyan.ben10@live.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-08 18:10:13 +00:00
Nikita Sobolev
992c3f6b51
[3.12] gh-108303: Move more typing related files to Lib/test/typinganndata (GH-111825) (#111859)
[3.12] gh-108303: Move more typing related files to Lib/test/typinganndata(GH-111825)
2023-11-08 16:56:24 +00:00
Miss Islington (bot)
42699c82d7
[3.12] Glossary: Add "static type checker" (GH-111837) (#111854)
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:45:17 +00:00
Miss Islington (bot)
d35c94566a
[3.12] gh-111806: Fix test_recursion in test_richcmp on WASI builds (GH-111830) (GH-111831)
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:29 +00:00
Miss Islington (bot)
f70ae99cb4
[3.12] gh-111765: Move old PyFloat_* tests to Lib/test/test_capi/test_float.py (GH-111766) (GH-111818)
(cherry picked from commit a077b2fbb8)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-07 12:06:21 +00:00
Miss Islington (bot)
35141842d3
[3.12] gh-111729: update generic syntax for typing.Concatenate sample code in Doc/library/typing.rst (GH-111734) (#111814)
(cherry picked from commit c3e19c3a62)

Co-authored-by: 方糖 <cubesugarcheese@qq.com>
2023-11-07 01:00:16 +00:00
Miss Islington (bot)
c4e524c3f2
[3.12] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds (gh-111695) (gh-111769)
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:31:58 +00:00
Miss Islington (bot)
e0c2bf4672
[3.12] gh-111495: Add tests for PyComplex C API (GH-111591) (GH-111753)
(cherry picked from commit 24b5cbd3dc)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-05 08:12:57 +00:00
Miss Islington (bot)
fef32a1d08
[3.12] gh-111495: Add tests for PyFloat C API (GH-111624) (GH-111752)
(cherry picked from commit b452202a11)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-05 10:01:31 +02:00
Miss Islington (bot)
237b269298
[3.12] gh-111747: DOC: fix moved link to Documentation Translations (GH-111748) (#111749)
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:58 +00:00
Miss Islington (bot)
9c583f36d5
[3.12] gh-111724: Fix doctest ResourceWarning in howto/descriptor.rst (GH-111725) (#111727)
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:55:55 -04:00
Serhiy Storchaka
cd778b4917
[3.12] gh-111495: Test C API functions with extreme sizes and indices (GH-111631) (GH-111731)
(cherry picked from commit a8e1f474c2)
2023-11-04 12:28:34 +02:00
Miss Islington (bot)
3b839ccfdf
[3.12] gh-111159: Fix SyntaxError doctests for non-builtin exception classes (GH-111541) (#111732)
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:21:06 +00:00
Miss Islington (bot)
d15fac2a67
[3.12] gh-111644: Fix asyncio test_unhandled_exceptions() (GH-111713) (#111718)
gh-111644: Fix asyncio test_unhandled_exceptions() (GH-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: Victor Stinner <vstinner@python.org>
2023-11-04 06:29:20 +00:00
Miss Islington (bot)
02f8f781da
[3.12] gh-111644: Fix support threading_cleanup() (GH-111714) (#111716)
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:56:34 +00:00
Jelle Zijlstra
1a95ad68b4
[3.12] gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (GH-111655) (#111674)
(cherry picked from commit 3a1b09e6d0)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2023-11-03 07:02:07 -07:00
Miss Islington (bot)
4db71c3ca7
[3.12] gh-54434: Make difflib.rst doctests pass. (GH-111677) (#111678)
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:55 +00:00
Miss Islington (bot)
1c84a48032
[3.12] Fix typo in documentation of SysLogHandler.createSocket (GH-111665) (#111669)
(cherry picked from commit 489b80640f)
2023-11-02 22:58:20 +00:00
Miss Islington (bot)
fcf91cd35f
[3.12] gh-111625: Fix link to Info-ZIP homepage (GH-111626) (#111639)
Co-authored-by: partev <petrosyan@gmail.com>
2023-11-02 12:04:27 +00:00
Kumar Aditya
9aa88290d8
[3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (#111632)
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)
2023-11-02 08:18:49 +00:00
Miss Islington (bot)
99f0dd88b1
[3.12] gh-111253: Fix error checking in _socket module init (GH-111254) (#111299)
gh-111253: Fix error checking in _socket module init (GH-111254)
(cherry picked from commit 3052c098ca)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-01 21:01:28 +01:00
Miss Islington (bot)
a94bdc2459
[3.12] gh-111295: Fix error checking in time extension module init (GH-111296) (#111300)
gh-111295: Fix error checking in time extension module init (GH-111296)

Introduce ADD_INT macro wrapper for PyModule_AddIntConstant()
(cherry picked from commit 81b03e7810)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-01 20:58:02 +01:00