Commit Graph

120150 Commits

Author SHA1 Message Date
Stephen Gildea 4d5d9acb22
gh-90890: Reorder mailbox.Maildir method documentation (GH-113071)
When new mailbox.Maildir methods were added for 3.13.0a2, their
documentation was added at the end of the mailbox.Maildir section
instead of grouping them with other methods Maildir adds to Mailbox.

This commit moves the new methods' documentation adjacent to
documentation for existing Maildir-specific methods, so that
the "special remarks" for common methods remains at the end.
2023-12-14 09:53:08 +02:00
Serhiy Storchaka b4f2c89118
gh-113086: Add tests for os.chmod() and os.lchmod() (GH-113087)
Also make test_copymode_symlink_to_symlink in test_shutil more strict.
2023-12-14 09:16:06 +02:00
Steve Dower fddc829236
gh-86179: Implement realpath() on Windows for getpath.py calculations (GH-113033) 2023-12-13 23:41:43 +00:00
Guido van Rossum 41c18aacc7
Move optimizer/executor tests to new file test_capi/test_opt.py (#113072) 2023-12-13 21:49:29 +00:00
Pavol Babinčák‏ f5c05e015c
bpo-40648: Test modes that file can get with chmod() on Windows (GH-20130)
Order of tests matter second part makes testing file writable and
possible to remove again.
2023-12-13 22:23:13 +02:00
Christoph Anton Mitterer f14e3d59c9
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.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-12-13 21:55:31 +02:00
Miro Hrončok 85923cb377
Docs: Fix external link to devguide.python.org (GH-112899) 2023-12-13 11:37:13 -08:00
Alex Waygood d05a180350
gh-101100: Improve docs on exception attributes (GH-113057)
* Improve docs on exception attributes

* thanks sphinx-lint

* fix doctests

* argh, okay, give up on doctests

* Various improvements
2023-12-13 10:59:36 -08:00
Raymond Hettinger 2111795d0c
Use match/case in grouper() recipe (gh-113059)
Use match/case in grouper() reciper
2023-12-13 12:11:52 -06:00
Eric Snow 480b4b359d
gh-76785: Fix CODEOWNERS (gh-113038)
In gh-112982 I made some changes to .github/CODEOWNERS.  Later, @ezio-melotti pointed out that some of those changes were unnecessary.
2023-12-13 09:29:40 -07:00
Diego Russo 6644ca45cd
gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959)
Fix the same issue of PR #112604 on PPC64LE platform
Refactor tests to make easier to add more platfroms if needed.
2023-12-13 17:08:15 +01:00
Steve Dower 79dad03747
gh-111650: Ensure pyconfig.h includes Py_GIL_DISABLED on Windows (GH-112778) 2023-12-13 15:38:45 +00:00
Donghee Na 498a096a51
gh-112205: Support `@setter` annotation from AC (gh-112922)
---------

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-13 14:00:34 +00:00
Mark Shannon 9263173280
Fix whitespace in generated code 2023-12-13 12:31:41 +00:00
Sequew 2a3c37c273
[pprint]: Add docstring about `PrettyPrinter.underscore_numbers` parameter (#112963)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-12-13 12:04:17 +00:00
Irit Katriel 428c9812cb
gh-112962: in dis module, put cache information in the Instruction instead of creating fake Instructions to represent it (#113016) 2023-12-13 12:00:21 +00:00
Hugo van Kemenade 3531ea441b
gh-101100: Fix Sphinx warning in references with asterisks (#113029)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-13 09:24:55 +02:00
beavailable 3aea6c4823
gh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485) 2023-12-13 03:23:29 +00:00
Jamie a3a1cb4845
gh-112622: Pass name to loop create_task method (#112623)
This affects task creation through either `asyncio.create_task()` or `TaskGroup.create_task()` -- the redundant call to `task.set_name()` is skipped. We still call `set_name()` when a task factory is involved, because the task factory call signature (unfortunately) doesn't take a `name` argument.
2023-12-12 17:26:40 -08:00
Eric Snow c6e614fd81
gh-76785: Avoid Pickled TracebackException for Propagated Subinterpreter Exceptions (gh-113036)
We need the TracebackException of uncaught exceptions for a single purpose: the error display.  Thus we only need to pass the formatted error display between interpreters.  Passing a pickled TracebackException is overkill.
2023-12-13 00:31:30 +00:00
J. Nick Koston 7e2d93f30b
gh-112989: asyncio: Reduce overhead to connect sockets with SelectorEventLoop (#112991)
_ensure_fd_no_transport had a KeyError in the success path
2023-12-12 16:29:21 -08:00
Sam Gross a3c031884d
gh-112723: Call `PyThreadState_Clear()` from the correct interpreter (#112776)
The `PyThreadState_Clear()` function must only be called with the GIL
held and must be called from the same interpreter as the passed in
thread state. Otherwise, any Python objects on the thread state may be
destroyed using the wrong interpreter, leading to memory corruption.

This is also important for `Py_GIL_DISABLED` builds because free lists
will be associated with PyThreadStates and cleared in
`PyThreadState_Clear()`.

This fixes two places that called `PyThreadState_Clear()` from the wrong
interpreter and adds an assertion to `PyThreadState_Clear()`.
2023-12-12 17:20:21 -07:00
Eric Snow 8a4c1f3ff1
gh-76785: Show the Traceback for Uncaught Subinterpreter Exceptions (gh-113034)
When an exception is uncaught in Interpreter.exec_sync(), it helps to show that exception's error display if uncaught in the calling interpreter.  We do so here by generating a TracebackException in the subinterpreter and passing it between interpreters using pickle.
2023-12-13 00:00:54 +00:00
Guido van Rossum 7316dfb0eb
gh-112320: Implement on-trace confidence tracking for branches (#112321)
We track the confidence as a scaled int.
2023-12-12 21:43:08 +00:00
Michael Droettboom dfaa9e060b
gh-113010: Don't decrement deferred in pystats (#113032)
This fixes a recently introduced bug where the deferred count is being unnecessarily decremented to counteract an increment elsewhere that is no longer happening. This caused the values to flip around to "very large" 64-bit numbers.
2023-12-12 21:17:08 +00:00
Alex Waygood 81a15ea74e
gh-101100: Further improve docs on function attributes (#113001) 2023-12-12 20:21:12 +00:00
Mark Shannon 956023826a
GH-108866: Guarantee forward progress in executors. (GH-113006) 2023-12-12 19:02:24 +00:00
Eric Snow 9898e61041
gh-76785: Add Interpreter.prepare_main() (gh-113021)
This is one of the last pieces to get test.support.interpreters in sync with PEP 734.
2023-12-12 18:06:06 +00:00
Eric Snow a49b427b02
gh-76785: More Fixes for test.support.interpreters (gh-113012)
This brings the module (along with the associated extension modules) mostly in sync with PEP 734.  There are only a few small things to wrap up.
2023-12-12 17:43:30 +00:00
Eric Snow cde1417175
gh-76785: Fix test_threading on Non-Subinterpreter Builds (gh-113014)
gh-112982 broke test_threading on one of the s390 buildbots (Fedora Clang Installed).  Apparently ImportError is raised (rather than ModuleNotFoundError) for the name part of "from" imports.  This fixes that by catching ImportError in test_threading.py.
2023-12-12 16:54:39 +00:00
Serhiy Storchaka fe9991bb67
gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000) 2023-12-12 18:31:04 +02:00
Hugo van Kemenade eafc2381a0
Update pre-commit to fix Sphinx Lint (#113015) 2023-12-12 16:29:08 +00:00
Eric Snow 86a77f4e1a
gh-76785: Fixes for test.support.interpreters (gh-112982)
This involves a number of changes for PEP 734.
2023-12-12 08:24:31 -07:00
Ronald Oussoren f26bfe4b25
gh-51944: fix type and missing addition in gh-112823 (#112996)
Fix the defition of VDSUSP and add CCTS_OFLOW (which
was mentioned in NEWS, but not actually addded)
2023-12-12 13:57:45 +01:00
Mark Shannon 0c55f27060
GH-111485: Factor out tier 2 code generation from the rest of the interpreter code generator (GH-112968) 2023-12-12 12:12:17 +00:00
Sam James c454e934d3
gh-112970: Detect and use closefrom() when available (#112969)
glibc-2.34 implements closefrom(3) using the same semantics as on BSD.
Check for closefrom() in configure and use the check result in
fileutils.c, rather than hardcoding a FreeBSD check.

Some implementations of closefrom() return an int. Explicitly discard 
the return value by casting it to void, to avoid future compiler
warnings.

Signed-off-by: Sam James <sam@gentoo.org>
2023-12-12 11:25:27 +01:00
Ronald Oussoren 0d2fe6bab0
gh-87286: Add a number of LOG_* constants to syslog (#24432)
* bpo-43120: Add a number of LOG_* constants to syslog

This adds a number of syslog facilities to the syslogmodule.c.
These values are available on macOS.

* Switch contant documentation to the data directive

This fixes a CI warning and matches the pattern
used in the documentation for ``os``.

* Update Doc/library/syslog.rst


Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-12 10:25:51 +01:00
Terry Jan Reedy e0fb7004ed
gh-112953: Rename idlelib/NEWS.txt to News3.txt and update (#112988) 2023-12-12 01:00:51 -05:00
wim glenn 616622cab7
gh-112983: Add the known magic value of 3495 for Python 3.11 bytecode (#112985)
Add the known magic value of 3495 for Python 3.11 bytecode
2023-12-11 18:47:12 -07:00
Guido van Rossum 5b86644338
A smattering of cleanups in uop debug output and lltrace (#112980)
* Include destination T1 opcode in Error debug message
* Include destination T1 opcode in DEOPT debug message
* Remove obsolete comment from remove_unneeded_uops
* Change lltrace_instruction() to print caller's opcode/oparg
2023-12-11 16:42:30 -08:00
Sam Gross fdee7b7b3e
gh-112532: Require mimalloc in `--disable-gil` builds (gh-112883) 2023-12-12 09:04:48 +09:00
Yan Yanchii fed294c645
gh-112978: Remove redundant condition inside `take_gil` (gh-112979) 2023-12-12 08:23:41 +09:00
Steve Dower 1c5fc02fd0
gh-71383: Update Tcl/Tk version in Windows to our patched build containing a targeted upstream fix (GH-112973) 2023-12-11 21:54:17 +00:00
achhina a01022af23
GH-83162: Rename re.error for better clarity. (#101677)
Renamed re.error for clarity, and kept re.error for backward compatibility.
Updated idlelib files at TJR's request.
---------

Co-authored-by: Matthias Bussonnier <mbussonnier@ucmerced.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-11 15:45:08 -05:00
colorfulappl 0066ab5bc5
gh-90350: Optimize builtin functions min() and max() (GH-30286)
Builtin functions min() and max() now use METH_FASTCALL
2023-12-11 21:27:06 +02:00
Sam Gross d70e27f258
gh-112529: Use atomic operations for `gcstate->collecting` (#112533)
* gh-112529: Use atomic operations for `gcstate->collecting`

The `collecting` field in `GCState` is used to prevent overlapping garbage
collections within the same interpreter. This is updated to use atomic
operations in order to be thread-safe in `--disable-gil` builds.

The GC code is refactored a bit to support this. More of the logic is pushed
down to `gc_collect_main()` so that we can safely order the logic setting
`collecting`, the selection of the generation, and the invocation of callbacks
with respect to the atomic operations and the (future) stop-the-world pauses.

The change uses atomic operations for both `--disable-gil` and the default
build (with the GIL) to avoid extra `#ifdef` guards and ease the maintenance
burden.
2023-12-11 18:33:21 +00:00
Nikita Sobolev 0738b9a338
gh-108303: Move `double_const` to `test_import` where it belongs (#112108) 2023-12-11 19:29:43 +01:00
James Morris d7b5f10231
gh-112507: Detect Cygwin and MSYS with `uname` instead of `$OSTYPE` (GH-112508)
Detect Cygwin and MSYS with `uname` instead of `$OSTYPE`

`$OSTYPE` is not defined by POSIX and may not be present in other shells.
`uname` is always available in any shell.
2023-12-11 17:27:15 +00:00
Christopher Chavez f4fe65e2dd
gh-111178: Avoid calling functions from incompatible pointer types in memoryobject.c (GH-112863)
* Make memory_clear() compatible with inquiry
* Make memory_traverse() compatible with traverseproc
* Make memory_dealloc() compatible with destructor
* Make memory_repr() compatible with reprfunc
* Make memory_hash() compatible with hashfunc
* Make memoryiter_next() compatible with iternextfunc
* Make memoryiter_traverse() compatible with traverseproc
* Make memoryiter_dealloc() compatible with destructor
* Make several functions compatible with getter
* Make a few functions compatible with getter
* Make memory_item() compatible with ssizeargfunc
* Make memory_subscript() compatible with binaryfunc
* Make memory_length() compatible with lenfunc
* Make memory_ass_sub() compatible with objobjargproc
* Make memory_releasebuf() compatible with releasebufferproc
* Make memory_getbuf() compatible with getbufferproc
* Make mbuf_clear() compatible with inquiry
* Make mbuf_traverse() compatible with traverseproc
* Make mbuf_dealloc() compatible with destructor
2023-12-11 17:43:07 +01:00
Sidney Markowitz 27a5fd8cb8
gh-94606: Fix error when message with Unicode surrogate not surrogateescaped string (GH-94641)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-11 18:21:18 +02:00