Commit graph

118265 commits

Author SHA1 Message Date
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
Miss Islington (bot)
f1087855e2
[3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) (GH-111607)
(cherry picked from commit 97b3cd38d1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-01 18:23:39 +00:00
Victor Stinner
d3d2cfead7
[3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111588)
Constants like Py_MOD_PER_INTERPRETER_GIL_SUPPORTED were only added
to the limited C API version 3.12 and newer.
2023-11-01 18:13:31 +01:00
Miss Islington (bot)
e2557947a4
[3.12] gh-111576: Improve documention for tkinter.messagebox (GH-111578) (GH-111597)
(cherry picked from commit eaf67e37a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-01 12:43:14 +02:00
Sergey B Kirpichev
9619e517d4
[3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592)
This is to reduce merge conflicts (Modules/Setup.stdlib.in) for
subsequent pull requests for the issue.
(cherry picked from commit 33ed5fa69d)
2023-11-01 09:43:56 +02:00
Miss Islington (bot)
2162512d71
[3.12] gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (GH-111577) (#111589)
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:51:24 +00:00
Miss Islington (bot)
21c8fbf28d
[3.12] gh-111282: Fix NamedTemporaryFile example code (GH-111283) (GH-111579)
(cherry picked from commit 102685c4c8)

Co-authored-by: Krzysiek Karbowiak <krzysztof.karbowiak@interia.pl>
2023-10-31 22:14:21 +00:00
Miss Islington (bot)
ec00397912
[3.12] gh-111181: Fix enum doctests (GH-111180) (GH-111518)
gh-111181: Fix enum doctests (GH-111180)
(cherry picked from commit c4dc5a6ae8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-10-31 15:01:28 -07:00
Pablo Galindo Salgado
4f619e83fe
[3.12] gh-109181: Speed up Traceback object creation by lazily compute the line number (GH-111548) (#111551)
.
(cherry picked from commit abb15420c1)
2023-10-31 18:18:11 +00:00
Miss Islington (bot)
b1da63468e
[3.12] gh-102249: Expand sys.call_tracing documentation (GH-102806) (#111557)
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:12 +02:00
Miss Islington (bot)
71e138d93e
[3.12] gh-93607: document root attribute of iterparse (GH-99410) (#111555)
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:27:37 +00:00
Miss Islington (bot)
c21387c6b2
[3.12] gh-106861: Docs: Add availability directives to all Unix-only modules (GH-108975) (#111553)
Co-authored-by: xzmeng <aumo@foxmail.com>
2023-10-31 16:22:50 +00:00
Miss Islington (bot)
dde5a99ba2
[3.12] gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533) (GH-111535)
(cherry picked from commit e3353c498d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-31 07:26:31 +00:00
Hugo van Kemenade
e820d7603b
[3.12] gh-111301: Move importlib.resources.files change to What's new in Python 3.12 (#111512) (#111534)
Co-authored-by: Karolina Surma <33810531+befeleme@users.noreply.github.com>
2023-10-31 06:49:24 +00:00
Miss Islington (bot)
1675c25495
[3.12] Remove myself from typing CODEOWNERS (GH-111523) (#111525)
Co-authored-by: Ken Jin <kenjin@python.org>
2023-10-30 21:47:22 +00:00
Pablo Galindo Salgado
ca36426b1c
[3.12] gh-111366: Correctly show custom syntax error messages in the codeop module functions (GH-111384). (#111517) 2023-10-30 19:53:01 +00:00
Miss Islington (bot)
7ac2c53333
[3.12] gh-111284: Make multiprocessing tests with threads faster and more reliable (GH-111285) (GH-111510)
(cherry picked from commit 624ace5a2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-30 18:00:57 +00:00
Miss Islington (bot)
748bc48648
[3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455) (GH-111507)
Also document the behavior when called with NULL.
(cherry picked from commit bca3305429)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-30 17:36:00 +00:00
Miss Islington (bot)
e5b6744f30
[3.12] gh-111165: Remove documentation for moved functions (GH-111467) (GH-111471)
(cherry picked from commit 4d6bdf8aab)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-29 19:43:53 +00:00
Miss Islington (bot)
577c808cf9
[3.12] gh-101100: Fix sphinx warnings in library/asyncio-eventloop.rst (GH-111222) (#111469)
gh-101100: Fix sphinx warnings in `library/asyncio-eventloop.rst` (GH-111222)

* gh-101100: Fix sphinx warnings in `library/asyncio-eventloop.rst`

* Update Doc/library/socket.rst



* Update asyncio-eventloop.rst

* Update socket.rst

---------

(cherry picked from commit 46389c3275)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-29 19:39:27 +00:00
Miss Islington (bot)
0681b4c82c
[3.12] gh-111347: Remove wrong assertion in test_sendfile (GH-111377) (#111461)
gh-111347: Remove wrong assertion in test_sendfile (GH-111377)

Windows is different.
(cherry picked from commit fa35b9e89b)

Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
2023-10-29 10:29:29 -07:00
Miss Islington (bot)
f7ce40213d
[3.12] gh-111426: Remove test_cmd.test_coverage (GH-111427) (#111432)
gh-111426: Remove `test_cmd.test_coverage` (GH-111427)
(cherry picked from commit 66bea2555d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-28 23:40:02 +00:00
Miss Islington (bot)
2e5d4e24eb
[3.12] gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336) (#111424)
gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336)

* Try to fix asyncio.Server.wait_closed() again

I identified the condition that `wait_closed()` is intended
to wait for: the server is closed *and* there are no more
active connections.

When this condition first becomes true, `_wakeup()` is called
(either from `close()` or from `_detach()`) and it sets `_waiters`
to `None`. So we just check for `self._waiters is None`; if it's
not `None`, we know we have to wait, and do so.

A problem was that the new test introduced in 3.12 explicitly
tested that `wait_closed()` returns immediately when the server
is *not* closed but there are currently no active connections.
This was a mistake (probably a misunderstanding of the intended
semantics). I've fixed the test, and added a separate test that
checks exactly for this scenario.

I also fixed an oddity where in `_wakeup()` the result of the
waiter was set to the waiter itself. This result is not used
anywhere and I changed this to `None`, to avoid a GC cycle.

* Update Lib/asyncio/base_events.py

---------

(cherry picked from commit 2655369559)

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-10-28 18:42:53 +00:00
Miss Islington (bot)
cf29a2f25e
[3.12] CI: Include Python version in cache.config key (GH-111410) (#111421)
CI: Include Python version in cache.config key (GH-111410)

* Include Python version in cache.config key, after Python setup

* Remove EOL 3.7 from branch triggers
(cherry picked from commit 9d4a1a480b)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-28 07:57:55 +00:00
Miss Islington (bot)
c3f75b757f
[3.12] gh-111342: fix typo in math.sumprod (GH-111416) (gh-111419) 2023-10-28 05:27:33 +00:00
Miss Islington (bot)
2398036eea
[3.12] gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() (GH-110884) (#111412)
- `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything.
- Threads created by that class are now named `asyncio-waitpid-NNN`.
- `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
(cherry picked from commit c3bb10c930)

Co-authored-by: Guido van Rossum <guido@python.org>
2023-10-27 16:36:05 -07:00
Miss Islington (bot)
754fda88d1
[3.12] gh-111406: Fix broken link to bpython's site (GH-111407) (#111408)
gh-111406: Fix broken link to bpython's site (GH-111407)
(cherry picked from commit 8a158a753c)

Co-authored-by: Zack Cerza <zack@cerza.org>
2023-10-27 18:44:33 +00:00
Miss Islington (bot)
713210985b
[3.12] gh-111276: Clarify docs and comments about the role of LC_CTYPE (GH-111319) (#111391)
Fix locale.LC_CTYPE documentation to no longer mention string.lower() et al. Those functions were removed in Python 3.0:
https://docs.python.org/2/library/string.htmlGH-deprecated-string-functions

Also, fix a comment in logging about locale-specific behavior of `str.lower()`.

(cherry picked from commit 6d42759c5e)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-27 17:15:06 +02:00
Miss Islington (bot)
883233dcc3
[3.12] gh-111343: Fix itertools docs: start arg is optional for count (gh-111344) (gh-111385) 2023-10-27 10:01:00 -05:00
Miss Islington (bot)
2014c23de3
[3.12] Fix typos in import system docs (GH-111396) (#111397)
Fix typos in import system docs (GH-111396)
(cherry picked from commit 9a2f2f46ca)

Co-authored-by: Jonathan Berthias <jvberthias@gmail.com>
2023-10-27 13:29:55 +00:00
Hugo van Kemenade
7d22e85550
[3.12] gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (GH-111188) (#111323) 2023-10-27 16:08:45 +03:00
Miss Islington (bot)
307ca78d7f
[3.12] gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (GH-111381) (#111382)
gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (GH-111381)
(cherry picked from commit 3d2f1f0b83)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-10-27 04:02:17 +00:00
Miss Islington (bot)
a70b2cd2d2
[3.12] GH-94438: Fix RuntimeWarning for jump tests in test_sys_settrace (GH-111369)
(cherry picked from commit a254120f2f)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-10-26 22:44:47 +00:00
Pablo Galindo Salgado
c81ebf5b3d
[3.12] bpo-43950: handle wide unicode characters in tracebacks (GH-28150) (#111346) 2023-10-27 06:43:38 +09:00
Miss Islington (bot)
e25d8b40cd
GH-111293: Fix DirEntry.inode dropping higher bits on Windows (GH-111294)
(cherry picked from commit b468538d35)

Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
2023-10-26 17:08:41 +00:00
Miss Islington (bot)
78c6faee08
[3.12] gh-111348: Fix direct invocation of test_doctest; remove test_doctest.test_coverage (GH-111349) (#111359)
gh-111348: Fix direct invocation of `test_doctest`; remove `test_doctest.test_coverage` (GH-111349)
(cherry picked from commit 31c05b72c1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-10-26 13:10:58 +00:00
Miss Islington (bot)
7cce26bcd9
[3.12] Docs: Add restart_events() and positional arg semantics for sys.monitoring (GH-111291) (#111335)
Docs: Add `restart_events()` and positional arg semantics for `sys.monitoring` (GH-111291)
(cherry picked from commit 3f84a19e62)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-10-25 18:13:05 +00:00
Miss Islington (bot)
3641dae42f
[3.12] gh-111165: Add missed "support." prefix for "verbose" (GH-111327) (GH-111328)
(cherry picked from commit a4981921aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 15:28:07 +00:00
Miss Islington (bot)
ed05bf6006
[3.12] gh-108590: Improve sqlite3 docs on encoding issues and how to handle those (GH-108699) (#111324)
Add a guide for how to handle non-UTF-8 text encodings.
Link to that guide from the 'text_factory' docs.

(cherry picked from commit 1262e41842)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Corvin <corvin@corvin.dev>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 14:08:10 +00:00
Artyom Romanov
3d67b69820
[3.12] Sync location of mypy pin with the main branch (#111317) 2023-10-25 12:54:05 +00:00
Serhiy Storchaka
5c4f9a1c7e
[3.12] gh-111165: Move test running code from test.support to libregrtest (GH-111166) (GH-111316)
Remove no longer used functions run_unittest() and run_doctest() from
the test.support module.
(cherry picked from commit f6a45a03d0)
2023-10-25 14:56:27 +03:00