Commit graph

116157 commits

Author SHA1 Message Date
Serhiy Storchaka
d4234937a1
[3.11] gh-112716: Fix SystemError when __builtins__ is not a dict (GH-112770) (GH-113105)
It was raised in two cases:
* in the import statement when looking up __import__
* in pickling some builtin type when looking up built-ins iter, getattr, etc.

(cherry picked from commit 1161c14e8c)
2023-12-14 12:59:33 +00:00
Miss Islington (bot)
08ff6fa23d
[3.11] gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091) (GH-113100)
(cherry picked from commit c6e953be12)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-14 14:01:01 +02:00
Miss Islington (bot)
e0c6995b4f
[3.11] Fixing typo in DocTestRunner docs (GH-112326) (GH-113098)
(cherry picked from commit b3c21265fa)

Co-authored-by: Daniel Wysocki <dwysocki@users.noreply.github.com>
2023-12-14 10:15:43 +00:00
Miss Islington (bot)
e4cdb74079
[3.11] gh-113086: Add tests for os.chmod() and os.lchmod() (GH-113087) (GH-113089)
Also make test_copymode_symlink_to_symlink in test_shutil more strict.
(cherry picked from commit b4f2c89118)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-14 07:33:35 +00:00
Miss Islington (bot)
a45a059afe
[3.11] bpo-40648: Test modes that file can get with chmod() on Windows (GH-20130) (GH-113069)
Order of tests matter second part makes testing file writable and
possible to remove again.
(cherry picked from commit f5c05e015c)

Co-authored-by: Pavol Babinčák‏ <scroolik@gmail.com>
2023-12-13 20:48:43 +00:00
Miss Islington (bot)
694631ca14
[3.11] gh-107959: clarify Unix-availability of os.lchmod() (GH-107960) (GH-113067)
gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

(cherry picked from commit f14e3d59c9)

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-12-13 20:02:07 +00:00
Miss Islington (bot)
f35322502a
[3.11] [doc] Make subprocess.wait documentation more precise (GH-98700) (#112154)
[doc] Make subprocess.wait documentation more precise (GH-98700)

[doc] Make subprocess.wait doc more precise

An active loop is only used when the `timeout` parameter is used on
POSIX.

When no timeout is used, the code calls `os.waitpid` internally (which puts
the process on a sleep status). On Windows, the internal Windows API
call accepts a timeout parameter, so that is delegated to the OS.
(cherry picked from commit 81ab0e8a4a)

Co-authored-by: Luis Pedro Coelho <luis@luispedro.org>
2023-12-13 12:01:36 -08:00
Miss Islington (bot)
4c45927c3f
[3.11] Docs: Fix external link to devguide.python.org (GH-112899) (#113064)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2023-12-13 19:48:44 +00:00
Miss Islington (bot)
9b3447ca3c
[3.11] gh-101100: Improve docs on exception attributes (GH-113057) (#113062)
gh-101100: Improve docs on exception attributes (GH-113057)

(cherry picked from commit d05a180350)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-13 19:07:19 +00:00
Miss Islington (bot)
5fd915df6e
[3.11] [pprint]: Add docstring about PrettyPrinter.underscore_numbers parameter (GH-112963) (#113052)
[pprint]: Add docstring about `PrettyPrinter.underscore_numbers` parameter (GH-112963)
(cherry picked from commit 2a3c37c273)

Co-authored-by: Sequew <88668176+KrySeyt@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-12-13 12:38:19 +00:00
Hugo van Kemenade
51858aa606
[3.11] gh-101100: Fix Sphinx warning in references with asterisks (GH-113029) (#113044) 2023-12-13 11:02:20 +02:00
Alex Waygood
b8a6eeec39
[3.11] gh-101100: Further improve docs on function attributes (#113001) (#113031)
(cherry-picked from commit 81a15ea74e)
2023-12-12 20:36:51 +00:00
Serhiy Storchaka
f78f6b6e89
[3.11] gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000) (GH-113020)
(cherry picked from commit fe9991bb67)
2023-12-12 17:17:35 +00:00
Miss Islington (bot)
8298f44136
[3.11] Update pre-commit to fix Sphinx Lint (GH-113015) (#113018)
Update pre-commit to fix Sphinx Lint (GH-113015)
(cherry picked from commit eafc2381a0)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-12 16:30:49 +00:00
Miss Islington (bot)
11f9502192
[3.11] [3.12] gh-83162: Rename re.error in idlelib (GH-101677) (GH-112987) (#113013)
Backport idlelib part of GH-101677 with simple rename.
(cherry picked from commit fd3b894725)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-12 16:21:07 +00:00
Alex Waygood
f83087ce03
[3.11] gh-101100: Improve documentation on function attributes (#112933) (#113003)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-12 14:19:02 +02:00
Terry Jan Reedy
ada2d77977
[3.11] gh-112953: Rename idlelib/NEWS.txt to News3.txt and update (GH… (#112992) 2023-12-12 06:10:29 +00:00
Miss Islington (bot)
70e50c0756
[3.11] gh-108303: Move double_const to test_import where it belongs (GH-112108) (#112977)
gh-108303: Move `double_const` to `test_import` where it belongs (GH-112108)
(cherry picked from commit 0738b9a338)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-11 18:46:02 +00:00
Miss Islington (bot)
5aec2d2452
[3.11] gh-94606: Fix error when message with Unicode surrogate not surrogateescaped string (GH-94641) (GH-112972)
(cherry picked from commit 27a5fd8cb8)

Co-authored-by: Sidney Markowitz <sidney@sidney.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-11 16:47:25 +00:00
Miss Islington (bot)
a37e1473da
[3.11] gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939) (#112961)
gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939)

* gh-112898: warn about unsaved files when quitting IDLE on macOS

Implement the TK function ``::tk::mac::Quit`` on macOS to
ensure that IDLE asks about saving unsaved files when
quitting IDLE.

(cherry picked from commit 3251ba8f1a)


Co-authored-by: Christopher Chavez chrischavez@gmx.us

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-11 17:14:45 +01:00
Miss Islington (bot)
449fdfca96
[3.11] Fix SyntaxWarning in test_syntax.py (GH-112944) (GH-112956)
(cherry picked from commit 97cd45bfdb)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2023-12-11 12:09:03 +00:00
Hugo van Kemenade
2f2668391c
[3.11] GH-101986: Support translation for Limited/Unstable API & Stable ABI (GH-107680) (#112941)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-12-10 12:28:10 -07:00
Miss Islington (bot)
95f5c8c46c
[3.11] gh-109980: Fix test_tarfile_vs_tar on macOS (GH-112905) (#112928)
gh-109980: Fix test_tarfile_vs_tar on macOS (GH-112905)

On recentish macOS versions the system tar
command includes system metadata (ACLs, extended attributes
and resource forks) in the tar archive, which
shutil.make_archive will not do. This can cause
spurious test failures.
(cherry picked from commit dd2ebdf89f)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-10 19:50:10 +01:00
Miss Islington (bot)
4cc9e875c2
[3.11] gh-101100: Fix Sphinx warning in library/http.cookies.rst (GH-112908) (#112930)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Fix Sphinx warning in library/http.cookies.rst (GH-112908)
2023-12-10 12:59:29 +00:00
Miss Islington (bot)
58219bfce6
[3.11] Docs: Use 'f-strings' as header (GH-112888) (#112924)
Docs: Use 'f-strings' as header (GH-112888)
(cherry picked from commit 5bf7580d72)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-10 11:36:25 +02:00
Miss Islington (bot)
671f3d3ccd
[3.11] IDLE: Tweak iomenu.IOBinding.maybesave (GH-112914) (#112918)
Add docstring, use f-string, simplify code.
(cherry picked from commit ca1bde8943)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-10 02:56:07 +00:00
Alex Waygood
8c51e4030a
[3.11] gh-101100: Fix Sphinx nitpicks in library/tempfile.rst (#112886) (#112913)
(cherry-picked from commit 54410e6bd9)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-09 22:56:01 +00:00
Miss Islington (bot)
c95aa4e310
[3.11] gh-101100: Improve documentation of TracebackType attributes (GH-112884) (#112912)
gh-101100: Improve documentation of `TracebackType` attributes (GH-112884)
(cherry picked from commit 96f64a2b1b)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-09 22:50:01 +00:00
Miss Islington (bot)
2d8012f852
[3.11] gh-79429: Ignore FileNotFoundError when remove a temporary directory in the multiprocessing finalizer (GH-112865) (GH-112897)
(cherry picked from commit 7e82c626c4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-09 13:31:42 +00:00
Alex Waygood
23234e9223
[3.11] gh-101100: Fix Sphinx nits in library/contextlib.rst (#112870) (#112874)
(cherry-picked from commit e4c0876033)
2023-12-08 14:03:15 +00:00
Miss Islington (bot)
161cfd0dda
[3.11] gh-101100: Improve documentation for attributes on instance methods (GH-112832) (#112873)
gh-101100: Improve documentation for attributes on instance methods (GH-112832)
(cherry picked from commit ed21d0c1f4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-08 13:25:05 +00:00
Miss Islington (bot)
5a11bcbf71
[3.11] gh-101100: Fix Sphinx nitpicks in library/shelve.rst (GH-112836) (#112869)
gh-101100: Fix Sphinx nitpicks in `library/shelve.rst` (GH-112836)
(cherry picked from commit 3cdcc2edf8)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-08 12:38:40 +00:00
Łukasz Langa
1e6d36da1e
[3.11] gh-110190: Temporarily skip new test introduced in gh-112604 on PPC64LE (GH-112818) (#112830)
(cherry picked from commit 9f67042f28)
2023-12-08 12:47:32 +01:00
Miss Islington (bot)
1eac0aab85
[3.11] gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834) (#112852)
gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834)

Test test_stress_modifying_handlers in test_signal can crash
the interpreter due to a bug in macOS. Filed as FB13453490
with Apple.
(cherry picked from commit bf0beae6a0)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-08 10:08:04 +01:00
Alex Waygood
cda1695799
[3.11] gh-101100: Silence Sphinx warnings when ntpath or posixpath are referenced (#112833) (#112858)
(cherry-picked from commit 2c3906bc4b)
2023-12-07 21:12:37 +00:00
Serhiy Storchaka
a18201bff1
[3.11] gh-79325: Fix recursion error in TemporaryDirectory cleanup on Windows (GH-112762) (GH-112848)
(cherry picked from commit b2923a61a1)
2023-12-07 17:46:30 +00:00
Serhiy Storchaka
5585334d77
[3.11] gh-91133: tempfile.TemporaryDirectory: fix symlink bug in cleanup (GH-99930) (GH-112839)
(cherry picked from commit 81c16cd94e)

Co-authored-by: Søren Løvborg <sorenl@unity3d.com>
2023-12-07 18:37:10 +02:00
Miss Islington (bot)
666a484d29
[3.11] gh-109981: Fix support.fd_count() on macOS 14 (GH-112797) (#112825)
gh-109981: Fix support.fd_count() on macOS 14 (GH-112797)

Use scanning "/dev/fd/" on macOS in support.fd_count(). That's both more efficient than scanning all possible file descriptors, and avoids crashing the interpreter when there are open "guarded" file descriptors.

"Guarded" file descriptors are a macOS feature where file descriptors used by system libraries are marked and cause hard crashes when used by "user" code.

(cherry picked from commit 953ee622b3)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-07 11:28:54 +01:00
Alex Waygood
5fa2d24002
[3.11] gh-101100: Improve documentation of code object attributes (#112781) (#112817)
(cherry-picked from commit e9707d3c3d)
2023-12-06 22:23:20 +00:00
Alex Waygood
1e719d374c
[3.11] gh-101100: Fix Sphinx nitpicks in library/reprlib.rst (#112811) (#112815)
(cherry-picked from commit 3870d19d15)
2023-12-06 22:04:33 +00:00
Diego Russo
b49c963e85
[3.11] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112766)
Set MAX_STRUCT_SIZE to 32 in stgdict.c when on Arm platforms.
This because on Arm platforms structs with at most 4 elements of any
floating point type values can be passed through registers. If the type
is double the maximum size of the struct is 32 bytes.
On x86-64 Linux, it's maximum 16 bytes hence we need to differentiate.

(cherry picked from commit bc68f4a4ab)
2023-12-06 16:57:42 +01:00
Miss Islington (bot)
010819a295
[3.11] gh-75666: Tkinter: "unbind(sequence, funcid)" now only unbinds "funcid" (GH-111322) (GH-112801)
Previously, "widget.unbind(sequence, funcid)" destroyed the current binding
for "sequence", leaving "sequence" unbound, and deleted the "funcid"
command.

Now it removes only "funcid" from the binding for "sequence", keeping
other commands, and deletes the "funcid" command.
It leaves "sequence" unbound only if "funcid" was the last bound command.

(cherry picked from commit cc7e45cc57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: GiovanniL <13402461+GiovaLomba@users.noreply.github.com>
2023-12-06 15:04:07 +00:00
Miss Islington (bot)
8be7282f29
[3.11] gh-111178: Docs: fix traverseproc, inquiry, and destructor parameters in slot typedefs table (GH-112742) (GH-112793)
gh-111178: Docs: fix `traverseproc`, `inquiry`, and `destructor` parameters in slot typedefs table (GH-112742)

In the slot typedefs table, the parameter of `destructor`
and the first parameter of `traverseproc` should both be
`PyObject *` rather than `void *`.
Same for `inquiry`.
(cherry picked from commit 00cce0fe49)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2023-12-06 11:03:36 +01:00
Miss Islington (bot)
02d09510d2
[3.11] gh-101100: Fix most Sphinx nitpicks in the glossary and stdtypes.rst (GH-112757) (#112790)
gh-101100: Fix most Sphinx nitpicks in the glossary and `stdtypes.rst` (GH-112757)
(cherry picked from commit e3f670e137)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-06 08:50:49 +00:00
Serhiy Storchaka
f92c8bfed6
[3.11] gh-108927: Include new dir test/regrtestdata in the installation (GH-112765) (GH-112784)
(cherry picked from commit f8c0198e3b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-06 08:12:08 +00:00
Alex Waygood
c26d6c1aba
[3.11] gh-101100: Properly document frame object attributes (#112735) (#112775)
* [3.11] gh-101100: Properly document frame object attributes (#112735)

(cherry-picked from commit d109f637c0)
2023-12-05 20:23:25 +00:00
Miss Islington (bot)
36f6fa4640
[3.11] gh-112769: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) (GH-112774)
zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813ff1)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2023-12-05 20:02:06 +00:00
Miss Islington (bot)
54ca4c64d0
[3.11] bpo-35332: Handle os.close() errors in shutil.rmtree() (GH-23766) (GH-112764)
* Ignore os.close() errors when ignore_errors is True.
* Pass os.close() errors to the error handler if specified.
* os.close no longer retried after error.

(cherry picked from commit 11d88a178b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 19:25:52 +00:00
Miss Islington (bot)
23920a0843
[3.11] bpo-43153: Don't mask PermissionError with NotADirectoryError during tempdirectory cleanup (GH-29940) (GH-112754)
(cherry picked from commit 8cdfee1bb9)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 13:44:49 +00:00
Miss Islington (bot)
80c314c9ce
[3.11] gh-101100: Fix many easily solvable Sphinx nitpicks in the datamodel docs (GH-112737) (#112749)
gh-101100: Fix many easily solvable Sphinx nitpicks in the datamodel docs (GH-112737)
(cherry picked from commit 2f20cafdbf)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-05 10:06:30 +00:00