Commit Graph

119914 Commits

Author SHA1 Message Date
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
Ronald Oussoren 3251ba8f1a
gh-112898: warn about unsaved files when quitting IDLE on macOS (#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. 

Co-authored-by: Christopher Chavez chrischavez@gmx.us
2023-12-11 15:22:36 +01:00
Mark Shannon c27e9d5d17
GH-111485: Factor out generation of uop IDs from cases generator. (GH-112877) 2023-12-11 14:14:36 +00:00
Anthony Sottile 97cd45bfdb
Fix SyntaxWarning in test_syntax.py (GH-112944) 2023-12-11 11:48:52 +00:00
Pablo Galindo Salgado a135a6d2c6
gh-112943: Correctly compute end offsets for multiline tokens in the tokenize module (#112949) 2023-12-11 11:44:22 +00:00
Alex Waygood 4c5b9c107a
gh-101100: Improve documentation on function attributes (#112933)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-11 12:00:42 +02:00
Adam Turner 9cdf05bc28
GH-101986: Support translation for Limited/Unstable API & Stable ABI (#107680)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-10 12:17:07 -07:00
Inada Naoki 42a86df3a3
Doc: c-api: fix order of PyMemberDef fields (#112879) 2023-12-11 02:43:17 +09:00
Brad Larsen eb27c9a99e
Add a fuzzer for `Py_CompileStringExFlags` (#111721) 2023-12-10 12:16:15 -05:00
Jelle Zijlstra 1f9cd3c1e5
Argument Clinic: fix bare "type" in annotations (#112915)
Bare "type" in annotations should be equivalent to "type[Any]"; see
https://discuss.python.org/t/inconsistencies-between-type-and-type/37404
and python/mypy#16366. It's better to use "type[object]", which is
safer and unambiguous.
2023-12-10 15:30:02 +00:00
Nikita Sobolev 9d02d3451a
gh-110686: Test pattern matching with `runtime_checkable` protocols (#110687) 2023-12-10 07:21:20 -08:00
Hugo van Kemenade 7595d47722
gh-101100: Fix Sphinx warning in library/http.cookies.rst (#112908)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-10 05:53:26 -07:00
Ronald Oussoren dd2ebdf89f
gh-109980: Fix test_tarfile_vs_tar on macOS (#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.
2023-12-10 12:38:49 +01:00
Hugo van Kemenade 5bf7580d72
Docs: Use 'f-strings' as header (#112888) 2023-12-10 10:39:51 +02:00
Terry Jan Reedy ca1bde8943
IDLE: Tweak iomenu.IOBinding.maybesave (#112914)
Add docstring, use f-string, simplify code.
2023-12-09 21:29:40 -05:00
Barney Gale 23df46a1dd
GH-112906: Fix performance regression in pathlib path initialisation (#112907)
This was caused by 76929fdeeb, specifically its use of `super()` and its
packing/unpacking `*args`.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-10 00:06:27 +00:00
Alex Waygood 96f64a2b1b
gh-101100: Improve documentation of `TracebackType` attributes (#112884) 2023-12-09 22:43:53 +00:00
Alex Waygood 54410e6bd9
gh-101100: Fix Sphinx nitpicks in `library/tempfile.rst` (#112886)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-09 22:08:01 +00:00
Neil Schemenauer 890ce430d9
gh-112867: fix for WITH_PYMALLOC_RADIX_TREE=0 (GH-112885)
The _obmalloc_usage structure is only defined if the obmalloc radix tree
is enabled.
2023-12-09 13:50:48 -08:00
Alex Waygood c1652d6d62
gh-110109: Fix installed buildbots now `pathlib` is a package (#112901) 2023-12-09 18:05:33 +00:00
Barney Gale a98e7a8112
GH-110109: Move pathlib ABCs to new `pathlib._abc` module. (#112881)
Move `_PurePathBase` and `_PathBase` to a new `pathlib._abc` module, and
drop the underscores from the class names.

Tests are mostly left alone in this commit, but they'll be similarly split
in a subsequent commit.

The `pathlib._abc` module will be published as an independent PyPI package
(similar to how `zipfile._path` is published as `zipp`), to be refined
and stabilised prior to its possible addition to the standard library.
2023-12-09 16:07:40 +01:00
Irit Katriel c98c40227e
gh-112720: Move instruction formatting from the dis.Instruction class to a new class dis.InstructionFormatter. Add the ArgResolver class. (#112722) 2023-12-09 10:03:02 +00:00
Gregory P. Smith 10e9bb13b8
gh-112334: Regression test that vfork is used when expected. (#112734)
Regression test that vfork is used when expected by subprocess.

This is written integration test style, it uses strace if it is present and appears to work to find out what system call actually gets used in different scenarios.

Test coverage is added for the default behavior and that of each of the specific arguments that must disable the use of vfork.  obviously not an entire test matrix, but it covers the most important aspects.

If there are ever issues with this test being flaky or failing on new platforms, rather than try and adapt it for all possible platforms, feel free to narrow the range it gets tested on when appropriate. That is not likely to reduce coverage.
2023-12-09 00:18:35 +00:00
Taylor Packard ed8720ace4
gh-112758: Updated pathlib documentation for PurePath.match (#112814) 2023-12-08 18:13:17 +00:00
Raymond Hettinger f3bff4ee9d
gh-112540: Support zero inputs in geometric_mean() (gh-112880) 2023-12-08 12:05:56 -06:00
Barney Gale 76929fdeeb
GH-110109: Add `pathlib._PurePathBase` (#110670)
Add private `pathlib._PurePathBase` class: a private superclass of both `PurePath` and `_PathBase`. Unlike `PurePath`, it does not define any of these special methods: `__fspath__`, `__bytes__`, `__reduce__`, `__hash__`, `__eq__`, `__lt__`, `__le__`, `__gt__`, `__ge__`. Its initializer and path joining methods accept only strings, not os.PathLike objects more broadly.

This is important for supporting *virtual paths*: user subclasses of `_PathBase` that provide access to archive files, FTP servers, etc. In these classes, the above methods should be implemented by users only as appropriate, with due consideration for the hash/equality of any backing objects, such as file objects or sockets.
2023-12-08 17:39:04 +00:00
AN Long 5a0137ca34
gh-112278: In _wmi, treat initialization timeout separately from connection timeout (GH-112878) 2023-12-08 16:52:22 +00:00
Sam Gross 4d1eea59bd
gh-112779: Check 1-byte atomics in configure (gh-112819) 2023-12-08 16:31:32 +00:00
Donghee Na c744dbe9ac
gh-112535: Update _Py_ThreadId() to support s390/s390x (gh-112751) 2023-12-08 23:28:07 +09:00
Seth Michael Larson e6ac25429f
gh-112302: Annotate SBOM file as generated in .gitattributes (#112854)
Annotate SBOM file as generated in .gitattributes
2023-12-08 14:46:19 +01:00
Alex Waygood ed21d0c1f4
gh-101100: Improve documentation for attributes on instance methods (#112832) 2023-12-08 13:18:53 +00:00
Alex Waygood e4c0876033
gh-101100: Fix Sphinx nits in `library/contextlib.rst` (#112870) 2023-12-08 13:17:57 +00:00
Alex Waygood 3cdcc2edf8
gh-101100: Fix Sphinx nitpicks in `library/shelve.rst` (#112836) 2023-12-08 14:31:11 +02:00
Mark Shannon aefdebdef1
GH-111485: Factor out opcode ID generator from the main cases generator. (GH-112831) 2023-12-08 11:48:30 +00:00
Ronald Oussoren 15a80b15af
gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS (#112828)
* gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS

A number of processor specific defines are different for x86-64 and
arm64, and need to be adjusted in pymacconfig.h.

* remove debug stuf
2023-12-08 10:09:34 +01:00
Serhiy Storchaka 4ac1e8fb25
Add a versionchanged directive for gh-94692 (GH-112846)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-08 10:18:15 +02:00
Barney Gale 28b2b7407c
GH-112675: Move path joining tests into `test_posixpath` and `test_ntpath` (#112676)
In `test_pathlib`, the `check_drive_root_parts` test methods evaluated
both joining and parsing/normalisation of paths. This dates from a time
when pathlib implemented both functions itself, but nowadays path joining
is done with `posixpath.join()` and `ntpath.join()`.

This commit moves the joining-related test cases into `test_posixpath` and
`test_ntpath`.
2023-12-07 21:45:40 +00:00