]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
13 months agogh-65169: Clarify prog default in argparse (GH-31602)
Stanley [Tue, 24 Sep 2024 10:57:37 +0000 (03:57 -0700)] 
gh-65169: Clarify prog default in argparse (GH-31602)

13 months agogh-123978: Remove broken time.thread_time() on NetBSD (GH-124116)
Serhiy Storchaka [Tue, 24 Sep 2024 08:26:25 +0000 (11:26 +0300)] 
gh-123978: Remove broken time.thread_time() on NetBSD (GH-124116)

13 months agogh-124188: Fix PyErr_ProgramTextObject() (GH-124189)
Serhiy Storchaka [Tue, 24 Sep 2024 08:01:37 +0000 (11:01 +0300)] 
gh-124188: Fix PyErr_ProgramTextObject() (GH-124189)

* Detect source file encoding.
* Use the "replace" error handler even for UTF-8 (default) encoding.
* Remove the BOM.
* Fix detection of too long lines if they contain NUL.
* Return the head rather than the tail for truncated long lines.

13 months agogh-72795: Make positional arguments with nargs='*' or REMAINDER non-required (GH...
Serhiy Storchaka [Tue, 24 Sep 2024 07:55:33 +0000 (10:55 +0300)] 
gh-72795: Make positional arguments with nargs='*' or REMAINDER non-required (GH-124306)

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.

13 months agogh-53780: Ignore the first "--" (double dash) between an option and command in argpar...
Serhiy Storchaka [Tue, 24 Sep 2024 07:35:28 +0000 (10:35 +0300)] 
gh-53780: Ignore the first "--" (double dash) between an option and command in argparse (GH-124275)

13 months agogh-63143: Fix parsing mutually exclusive arguments in argparse (GH-124307)
Serhiy Storchaka [Tue, 24 Sep 2024 07:23:07 +0000 (10:23 +0300)] 
gh-63143: Fix parsing mutually exclusive arguments in argparse (GH-124307)

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".

13 months agogh-124120: Document `Annotated.__origin__` (#124125)
sobolevn [Tue, 24 Sep 2024 06:53:04 +0000 (09:53 +0300)] 
gh-124120: Document `Annotated.__origin__` (#124125)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agogh-124127: Make Py_REFCNT() opaque in limited C API 3.14 (#124128)
Victor Stinner [Tue, 24 Sep 2024 06:42:58 +0000 (08:42 +0200)] 
gh-124127: Make Py_REFCNT() opaque in limited C API 3.14 (#124128)

13 months agogh-124130: Increase test coverage for \b and \B in regular expressions (GH-124330)
Serhiy Storchaka [Tue, 24 Sep 2024 06:31:10 +0000 (09:31 +0300)] 
gh-124130: Increase test coverage for \b and \B in regular expressions (GH-124330)

13 months agoFix typos (#124409)
Xie Yanbo [Tue, 24 Sep 2024 06:19:25 +0000 (14:19 +0800)] 
Fix typos (#124409)

13 months agogh-119180: Add discussion of annotations to the 3.14 What's New (#124393)
Jelle Zijlstra [Tue, 24 Sep 2024 05:50:13 +0000 (22:50 -0700)] 
gh-119180: Add discussion of annotations to the 3.14 What's New (#124393)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agogh-119333: Add C api to have contextvar enter/exit callbacks (#119335)
Jason Fried [Tue, 24 Sep 2024 03:40:17 +0000 (20:40 -0700)] 
gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
13 months agogh-123990: Good bye WITH_FREELISTS macro (gh-124358)
Donghee Na [Tue, 24 Sep 2024 01:28:59 +0000 (18:28 -0700)] 
gh-123990: Good bye WITH_FREELISTS macro (gh-124358)

13 months agogh-100980: ctypes: Test, document, and fix finalizing _fields_ (GH-124292)
Petr Viktorin [Tue, 24 Sep 2024 00:40:53 +0000 (02:40 +0200)] 
gh-100980: ctypes: Test, document, and fix finalizing _fields_ (GH-124292)

- If setting `_fields_` fails, e.g. with AttributeError, don't set the attribute in `__dict__`
- Document the “finalization” behaviour
- Beef up tests: add `getattr`, test Union as well as Structure
- Put common functionality in a common function

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
13 months agoLint and format Tools/build/check-warnings.py (#124382)
Hugo van Kemenade [Mon, 23 Sep 2024 23:47:05 +0000 (16:47 -0700)] 
Lint and format Tools/build/check-warnings.py (#124382)

13 months agogh-119004: fix a crash in equality testing between `OrderedDict` (#121329)
Bénédikt Tran [Mon, 23 Sep 2024 23:44:36 +0000 (01:44 +0200)] 
gh-119004: fix a crash in equality testing between `OrderedDict` (#121329)

13 months agogh-116622: Complete Android documentation (#124259)
Malcolm Smith [Mon, 23 Sep 2024 23:09:53 +0000 (00:09 +0100)] 
gh-116622: Complete Android documentation (#124259)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agogh-124102: Update internal PCbuild docs to accurately list build dependencies (GH...
Wulian [Mon, 23 Sep 2024 23:09:22 +0000 (07:09 +0800)] 
gh-124102: Update internal PCbuild docs to accurately list build dependencies (GH-124103)

13 months agoBump Ruff to 0.6.7 (#124384)
Alex Waygood [Mon, 23 Sep 2024 22:19:35 +0000 (15:19 -0700)] 
Bump Ruff to 0.6.7 (#124384)

13 months agoDoc: Add ``make dist-no-html`` (#124383)
Adam Turner [Mon, 23 Sep 2024 22:11:34 +0000 (23:11 +0100)] 
Doc: Add ``make dist-no-html`` (#124383)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
13 months agoGH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)
Brett Cannon [Mon, 23 Sep 2024 21:14:33 +0000 (14:14 -0700)] 
GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)

The code changes for warning related to `__package__` landed in Python 3.12. `__cached__` doesn't have any changes as it isn't used but only set by the import system.

13 months agogh-99108: Disable HACL SIMD code on older versions of Android (#124304)
Malcolm Smith [Mon, 23 Sep 2024 20:28:03 +0000 (21:28 +0100)] 
gh-99108: Disable HACL SIMD code on older versions of Android (#124304)

Disable HACL SIMD code on older versions of Android

13 months agoGH-87041: Fix incorrect indentation in argparse help (GH-124230)
Savannah Ostrowski [Mon, 23 Sep 2024 19:45:36 +0000 (12:45 -0700)] 
GH-87041: Fix incorrect indentation in argparse help (GH-124230)

In case of usage a long command along with max_help_position more than
the length of the command, the command's help was incorrectly started
on the new line.

Co-authored-by: Pavel Ditenbir <pavel.ditenbir@gmail.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Trivia (#124348)
Adam Turner [Mon, 23 Sep 2024 19:32:23 +0000 (20:32 +0100)] 
GH-109975: Copyedit 3.13 What's New: Trivia (#124348)

13 months agogh-124344: Make `_PyObject_IS_GC()` use underscored `PyType_IS_GC()` (#124349)
neonene [Mon, 23 Sep 2024 19:14:15 +0000 (04:14 +0900)] 
gh-124344: Make `_PyObject_IS_GC()` use underscored `PyType_IS_GC()` (#124349)

move up _PyType_IS_GC and use it

13 months agogh-119180: Fix annotationlib.ForwardRef.evaluate with no globals (#124326)
Jelle Zijlstra [Mon, 23 Sep 2024 19:06:19 +0000 (12:06 -0700)] 
gh-119180: Fix annotationlib.ForwardRef.evaluate with no globals (#124326)

We were sometimes passing None as the globals argument to eval(), which makes it
inherit the globals from the calling scope. Instead, ensure that globals is always
non-None. The test was passing accidentally because I passed "annotationlib" as a
module object; fix that. Also document the parameters to ForwardRef() and remove
two unused private ones.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Copyedit C API deprecations pending removal...
Adam Turner [Mon, 23 Sep 2024 18:40:20 +0000 (19:40 +0100)] 
GH-109975: Copyedit 3.13 What's New: Copyedit C API deprecations pending removal (#124336)

13 months agoGH-109975: Copyedit 3.13 What's New: Build Changes (#124343)
Adam Turner [Mon, 23 Sep 2024 18:30:45 +0000 (19:30 +0100)] 
GH-109975: Copyedit 3.13 What's New: Build Changes (#124343)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
13 months agoGH-124321: Fix argparse negative number parsing to capture -.5(GH-124322)
Savannah Ostrowski [Mon, 23 Sep 2024 18:16:55 +0000 (11:16 -0700)] 
GH-124321: Fix argparse negative number parsing to capture -.5(GH-124322)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Porting to Python 3.13 (#124341)
Adam Turner [Mon, 23 Sep 2024 18:14:37 +0000 (19:14 +0100)] 
GH-109975: Copyedit 3.13 What's New: Porting to Python 3.13 (#124341)

Copyedit Porting to Python 3.13

13 months agoGH-124284: Add stats for refcount operations on immortal objects (GH-124288)
Mark Shannon [Mon, 23 Sep 2024 18:10:55 +0000 (19:10 +0100)] 
GH-124284: Add stats for refcount operations on immortal objects (GH-124288)

13 months agoReplace the term `Immutable` with a `Hashable` in the `sequence` entry of the Glossar...
decorator-factory [Mon, 23 Sep 2024 16:34:08 +0000 (19:34 +0300)] 
Replace the term `Immutable` with a `Hashable` in the `sequence` entry of the Glossary (#124350)

The term `Immutable` in the `sequence` entry of the glossary is used incorrectly, in fact dicts accepts hashable keys, which is not the same as immutable.

13 months agogh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH...
Steve Dower [Mon, 23 Sep 2024 15:27:46 +0000 (16:27 +0100)] 
gh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH-124279)

13 months agoAdd Kirill Podoprigora for AST codeowners (#124302)
Kirill Podoprigora [Mon, 23 Sep 2024 14:16:19 +0000 (17:16 +0300)] 
Add Kirill Podoprigora for AST codeowners (#124302)

13 months agoGH-109975: Copyedit 3.13 What's New: C API (#124313)
Adam Turner [Mon, 23 Sep 2024 13:28:17 +0000 (14:28 +0100)] 
GH-109975: Copyedit 3.13 What's New: C API (#124313)

13 months agoGH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)
Savannah Ostrowski [Mon, 23 Sep 2024 09:08:03 +0000 (02:08 -0700)] 
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)

13 months agoGH-113655: Lower the C recursion limit for HPPA, PPC64 and SPARC (#124264)
Sam James [Mon, 23 Sep 2024 07:03:30 +0000 (08:03 +0100)] 
GH-113655: Lower the C recursion limit for HPPA, PPC64 and SPARC (#124264)

Lower the C recursion limit for HPPA, PPC64 and SPARC, as they use
relatively large stack frames that cause e.g. `test_descr` to hit
a stack overflow.  According to quick testing, it seems that values
around 8000 are max for HPPA and PPC64 (ELFv1 ABI) and 7000 for SPARC64.
To keep things safe, let's use 5000 for PPC64 and 4000 for SPARC.

Co-authored-by: Michał Górny <mgorny@gentoo.org>
13 months agogh-124130: Notes on empty string corner case of category `\B` (#124133)
Y5 [Mon, 23 Sep 2024 06:58:14 +0000 (06:58 +0000)] 
gh-124130: Notes on empty string corner case of category `\B` (#124133)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agogh-124228: Fix UUID test in configure files for NetBSD (#124229)
Furkan Onder [Mon, 23 Sep 2024 06:54:36 +0000 (09:54 +0300)] 
gh-124228: Fix UUID test in configure files for NetBSD (#124229)

Fix UUID configuration in configure files for NetBSD compatibility.

13 months agogh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output...
Terry Jan Reedy [Sun, 22 Sep 2024 19:51:09 +0000 (15:51 -0400)] 
gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (#124310)

https://github.com/python/cpython/issues/88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS.  While theoretically correct, the result was Shell freezing when receiving continuous short strings to print.  Test: `while 1: 1`.

The guess is that there is no idle time in which to do the screen update.  Reverting the change in one of the files,
outwin, fixes the issue.  Colorizer runs ever 1/20 second and seems to work fine.

When running test-outwin on macOS, alias 'update'
to 'update_idletasks on the text used for testing.

13 months agogh-124213: Skip tests failing inside systemd-nspawn --suppress-sync=true (#124215)
Michał Górny [Fri, 20 Sep 2024 13:37:49 +0000 (15:37 +0200)] 
gh-124213: Skip tests failing inside systemd-nspawn --suppress-sync=true (#124215)

Add a helper function that checks whether the test suite is running
inside a systemd-nspawn container, and skip the few tests failing
with `--suppress-sync=true` in that case.  The tests are failing because
`--suppress-sync=true` stubs out `fsync()`, `fdatasync()` and `msync()`
calls, and therefore they always return success without checking for
invalid arguments.

Call `os.open(__file__, os.O_RDONLY | os.O_SYNC)` and check the errno to
detect whether `--suppress-sync=true` is actually used, and skip
the tests only in that scenario.

13 months agogh-111513: Improve datetime.fromtimestamp's error message (#124249)
AN Long [Fri, 20 Sep 2024 12:42:43 +0000 (20:42 +0800)] 
gh-111513: Improve datetime.fromtimestamp's error message (#124249)

13 months agogh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (#124240)
Y5 [Fri, 20 Sep 2024 11:01:28 +0000 (11:01 +0000)] 
gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (#124240)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
13 months agoFix typo in XMLParser doc (#124129)
Jacob Walls [Fri, 20 Sep 2024 10:42:44 +0000 (07:42 -0300)] 
Fix typo in XMLParser doc (#124129)

13 months agogh-124248: Fix crash in struct when processing 0p fields (#124251)
Brian Schubert [Fri, 20 Sep 2024 10:08:59 +0000 (06:08 -0400)] 
gh-124248: Fix crash in struct when processing 0p fields (#124251)

13 months agogh-95468: Add more tests for "--" (double dash) in test_argparse (GH-124274)
Serhiy Storchaka [Fri, 20 Sep 2024 09:54:20 +0000 (12:54 +0300)] 
gh-95468: Add more tests for "--" (double dash) in test_argparse (GH-124274)

13 months agogh-123880: Allow recursive import of single-phase-init modules (GH-123950)
Petr Viktorin [Fri, 20 Sep 2024 08:27:34 +0000 (10:27 +0200)] 
gh-123880: Allow recursive import of single-phase-init modules (GH-123950)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
13 months agogh-123797: Check for runtime availability of `ptsname_r` on macos (#123806)
sobolevn [Fri, 20 Sep 2024 06:30:27 +0000 (09:30 +0300)] 
gh-123797: Check for runtime availability of `ptsname_r` on macos (#123806)

13 months agogh-81691: Fix handling of multiple "--" (double dashes) in argparse (GH-124233)
Serhiy Storchaka [Fri, 20 Sep 2024 06:20:47 +0000 (09:20 +0300)] 
gh-81691: Fix handling of multiple "--" (double dashes) in argparse (GH-124233)

Only the first one has now been removed, all subsequent ones are now
taken literally.

13 months agotest_cext, test_cppext: enable /W4 warnings on Windows (#124253)
Victor Stinner [Thu, 19 Sep 2024 20:32:01 +0000 (22:32 +0200)] 
test_cext, test_cppext: enable /W4 warnings on Windows (#124253)

Add an explicit cast to (void*) and add Py_UNUSED() to fix some
warnings in extension.c.

13 months agoDocs: Update two FAQs for Python 3 (#124247)
Hugo van Kemenade [Thu, 19 Sep 2024 18:50:05 +0000 (21:50 +0300)] 
Docs: Update two FAQs for Python 3 (#124247)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agogh-124245: Fix UserWarning in test_argparse (GH-124246)
Serhiy Storchaka [Thu, 19 Sep 2024 18:35:12 +0000 (21:35 +0300)] 
gh-124245: Fix UserWarning in test_argparse (GH-124246)

13 months agogh-124160: Pass main_tstate to update_global_state_for_extension() (#124164)
luk1337 [Thu, 19 Sep 2024 16:05:20 +0000 (18:05 +0200)] 
gh-124160: Pass main_tstate to update_global_state_for_extension() (#124164)

13 months agobpo-41843: Reenable use of sendfile in shutil module on Solaris (GH-23893)
Jakub Kulík [Thu, 19 Sep 2024 14:47:05 +0000 (16:47 +0200)] 
bpo-41843: Reenable use of sendfile in shutil module on Solaris (GH-23893)

13 months agoSupport the "pager" binary in _pyrepl (#122878)
Stefano Rivera [Thu, 19 Sep 2024 13:18:24 +0000 (06:18 -0700)] 
Support the "pager" binary in _pyrepl (#122878)

Debian (and derivatives) provide a /usr/bin/pager binary, managed by the
alternatives system, that always points to an available pager utility.
Allow _pyrepl to use it, to follow system policy.

This is a very trivial change, from a patch that Debian has been
carrying since 2.7 era. Seems appropriate to upstream.
https://bugs.debian.org/799555

13 months agogh-124040: Adjust few tests in testHypot/testDist to get exactly computed results...
Sergey B Kirpichev [Thu, 19 Sep 2024 08:11:03 +0000 (11:11 +0300)] 
gh-124040: Adjust few tests in testHypot/testDist to get exactly computed results (GH-124042)

13 months agogh-123934: Fix `MagicMock` not to reset magic method return values (#124038)
sobolevn [Thu, 19 Sep 2024 07:55:47 +0000 (10:55 +0300)] 
gh-123934: Fix `MagicMock` not to reset magic method return values (#124038)

13 months agogh-120754: Fix memory leak in FileIO.__init__() (#124225)
Victor Stinner [Wed, 18 Sep 2024 22:11:50 +0000 (00:11 +0200)] 
gh-120754: Fix memory leak in FileIO.__init__() (#124225)

Free 'self->stat_atopen' before assigning it, since
io.FileIO.__init__() can be called multiple times manually
(especially by test_io).

13 months agogh-124212: Fix undefined variable in error message in venv (GH-124211)
Jacek [Wed, 18 Sep 2024 22:05:18 +0000 (00:05 +0200)] 
gh-124212: Fix undefined variable in error message in venv (GH-124211)

13 months agogh-124083: Skip test_signal.test_strsignal() on NetBSD (#124084)
Furkan Onder [Wed, 18 Sep 2024 21:22:00 +0000 (00:22 +0300)] 
gh-124083: Skip test_signal.test_strsignal() on NetBSD (#124084)

Skip test_strsignal() on NetBSD due to TypeError.

13 months agoFix `make htmllive` target (GH-124219)
Zachary Ware [Wed, 18 Sep 2024 21:02:20 +0000 (16:02 -0500)] 
Fix `make htmllive` target (GH-124219)

Allow `make -C Doc htmllive` to work without manual venv activation

Set PATH to ensure that `sphinx-autobuild` can find `sphinx-build`.

13 months agogh-116022: Improve `repr()` of AST nodes (#117046)
Tomas R [Wed, 18 Sep 2024 17:28:22 +0000 (19:28 +0200)] 
gh-116022: Improve `repr()` of AST nodes (#117046)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agogh-124064: Fix -Wconversion warnings in Parser/string_parser.c (#124204)
Victor Stinner [Wed, 18 Sep 2024 17:10:56 +0000 (19:10 +0200)] 
gh-124064: Fix -Wconversion warnings in Parser/string_parser.c (#124204)

Fix integer overflow check in decode_unicode_with_escapes(): use
PY_SSIZE_T_MAX instead of SIZE_MAX.

13 months agogh-122145: Handle an empty AST body when reporting tracebacks (#122161)
Bénédikt Tran [Wed, 18 Sep 2024 16:42:33 +0000 (18:42 +0200)] 
gh-122145: Handle an empty AST body when reporting tracebacks (#122161)

13 months agogh-120754: Refactor I/O modules to stash whole stat result rather than individual...
Cody Maloney [Wed, 18 Sep 2024 15:47:57 +0000 (08:47 -0700)] 
gh-120754: Refactor I/O modules to stash whole stat result rather than individual members (#123412)

Multiple places in the I/O stack optimize common cases by using the
information from stat. Currently individual members are extracted from
the stat and stored into the fileio struct. Refactor the code to store
the whole stat struct instead.

Parallels the changes to _io. The `stat` Python object doesn't allow
changing members, so rather than modifying estimated_size, just clear
the value.

13 months agogh-124206: Fix calling get_annotate_function() on static types (#124208)
Jelle Zijlstra [Wed, 18 Sep 2024 15:39:22 +0000 (08:39 -0700)] 
gh-124206: Fix calling get_annotate_function() on static types (#124208)

Fixes #124206. No news entry because the bug this fixes was never
released.

13 months agogh-102511: Change the `os.path.splitroot` param name from `path` back to `p` (GH...
sobolevn [Wed, 18 Sep 2024 14:17:32 +0000 (17:17 +0300)] 
gh-102511: Change the `os.path.splitroot` param name from `path` back to `p` (GH-124097)

13 months agotest: fix _is_perf_version_at_least typo (#124199)
Sam James [Wed, 18 Sep 2024 12:44:32 +0000 (13:44 +0100)] 
test: fix _is_perf_version_at_least typo (#124199)

13 months agogh-118915: Add/fix docs entries for some new 3.13 C API (GH-124134)
Petr Viktorin [Wed, 18 Sep 2024 12:15:43 +0000 (14:15 +0200)] 
gh-118915: Add/fix docs entries for some new 3.13 C API (GH-124134)

13 months agogh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131)
Petr Viktorin [Wed, 18 Sep 2024 12:14:34 +0000 (14:14 +0200)] 
gh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
13 months agogh-119771: Set errno on overflows in _Py_c_pow() (#120256)
Sergey B Kirpichev [Wed, 18 Sep 2024 08:39:11 +0000 (11:39 +0300)] 
gh-119771: Set errno on overflows in _Py_c_pow() (#120256)

Before we did this in complex_pow() and behavior of the public C API
function _Py_c_pow() was different from the pure-python pow().

13 months agogh-124190: Ignore files directories check warning tooling (#124193)
Nate Ohlson [Wed, 18 Sep 2024 07:49:43 +0000 (02:49 -0500)] 
gh-124190: Ignore files directories check warning tooling (#124193)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
13 months agogh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163)
neonene [Wed, 18 Sep 2024 07:18:19 +0000 (16:18 +0900)] 
gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163)

13 months agoRevert "gh-123974: Fix time.get_clock_info() on NetBSD (#123975)" (GH-124115)
Serhiy Storchaka [Wed, 18 Sep 2024 06:29:24 +0000 (09:29 +0300)] 
Revert "gh-123974: Fix time.get_clock_info() on NetBSD (#123975)" (GH-124115)

This reverts commit b1d6f8a2ee04215c64aa8752cc515b7e98a08d28.

13 months agogh-124191: Disable -Wconversion in enable safety (gh-124192)
Nate Ohlson [Wed, 18 Sep 2024 03:55:09 +0000 (22:55 -0500)] 
gh-124191: Disable -Wconversion in enable safety (gh-124192)

13 months agogh-124194: Fix wrong issue number in What's New in Python 3.8 (#124195)
Bradley Reynolds [Wed, 18 Sep 2024 00:51:15 +0000 (19:51 -0500)] 
gh-124194: Fix wrong issue number in What's New in Python 3.8 (#124195)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agogh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines...
Jacek [Tue, 17 Sep 2024 17:16:43 +0000 (19:16 +0200)] 
gh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines (GH-123751)

13 months agogh-123836: workaround fmod(x, y) bug on Windows (#124171)
Sergey B Kirpichev [Tue, 17 Sep 2024 17:16:15 +0000 (20:16 +0300)] 
gh-123836: workaround fmod(x, y) bug on Windows (#124171)

Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):
FAIL: testFmod (test.test_math.MathTests.testFmod)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod
    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest
    self.fail("{}: {}".format(name, failure))
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)

Here Windows loose sign of the result; if y is nonzero, the result
should have the same sign as x.

This amends commit 28aea5d07d.

13 months agogh-110190: Fix ctypes structs with array on SPARC (GH-118233)
Jakub Kulík [Tue, 17 Sep 2024 17:06:53 +0000 (19:06 +0200)] 
gh-110190: Fix ctypes structs with array on SPARC (GH-118233)

13 months agogh-124064: Fix -Wconversion warnings in Parser/pegen.c (#124181)
Victor Stinner [Tue, 17 Sep 2024 15:58:43 +0000 (17:58 +0200)] 
gh-124064: Fix -Wconversion warnings in Parser/pegen.c (#124181)

13 months agogh-124064: Fix -Wconversion warnings in pycore_{long,object}.h (#124177)
Victor Stinner [Tue, 17 Sep 2024 15:35:40 +0000 (17:35 +0200)] 
gh-124064: Fix -Wconversion warnings in pycore_{long,object}.h (#124177)

Change also the fix for pycore_gc.h and pycore_stackref.h:
declare constants as uintptr_t, rather than casting constants.

13 months agoGH-103484: Fix broken links reported by linkcheck (#124169)
Rafael Fontenelle [Tue, 17 Sep 2024 15:05:15 +0000 (12:05 -0300)] 
GH-103484: Fix broken links reported by linkcheck (#124169)

13 months agogh-124064: Fix -Wconversion warnings in pycore_{gc,list,stackref}.h (#124174)
Victor Stinner [Tue, 17 Sep 2024 14:43:39 +0000 (16:43 +0200)] 
gh-124064: Fix -Wconversion warnings in pycore_{gc,list,stackref}.h (#124174)

13 months agoUse pep role instead of url (#121611)
Rafael Fontenelle [Tue, 17 Sep 2024 13:02:14 +0000 (10:02 -0300)] 
Use pep role instead of url (#121611)

13 months agoTools/build/stable_abi.py: Improve ergonomics (GH-105355)
Petr Viktorin [Tue, 17 Sep 2024 12:32:04 +0000 (14:32 +0200)] 
Tools/build/stable_abi.py: Improve ergonomics (GH-105355)

* Tools/build/stable_abi.py: Improve ergonomics

- Make the manifest file argument optional
- Output resolved paths with --list (getting rid of `../../`)
- Mention --all or --generate-all if no actions are specified

* Don't hardcode Misc/stable_abi.toml in Makefile, rely on the default

13 months agogh-123836: Check zero signs in math_testcases.txt (#123854)
Sergey B Kirpichev [Tue, 17 Sep 2024 08:22:40 +0000 (11:22 +0300)] 
gh-123836: Check zero signs in math_testcases.txt (#123854)

Just like cmath_testcases.txt. These tests require IEEE 754 anyway.

Correct zero sign for sqrt tests to match math.h convention.

13 months agoGH-123945: Update regex for parsing negative numbers that contain underscores (#123970)
Savannah Ostrowski [Tue, 17 Sep 2024 06:30:17 +0000 (23:30 -0700)] 
GH-123945: Update regex for parsing negative numbers that contain underscores (#123970)

---------

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
13 months agoGH-103484: Fix permanently redirects reported by linkcheck (GH-124144)
Rafael Fontenelle [Tue, 17 Sep 2024 02:53:38 +0000 (23:53 -0300)] 
GH-103484: Fix permanently redirects reported by linkcheck (GH-124144)

Fix redirects reported by linkcheck, update docs conf.py checks.

13 months agoGH-124108: Skip test_locale.test_strcoll_with_diacritic() on NetBSD (#124110)
Furkan Onder [Mon, 16 Sep 2024 23:00:36 +0000 (02:00 +0300)] 
GH-124108: Skip test_locale.test_strcoll_with_diacritic() on NetBSD (#124110)

Skip test_strcoll_with_diacritic() and test_strxfrm_with_diacritic()
of test_locale on NetBSD due to lack of UTF-8 LC_COLLATE
support.

13 months agogh-121023: Improve `_xxtestfuzz/README.rst` (#121024)
sobolevn [Mon, 16 Sep 2024 20:28:09 +0000 (23:28 +0300)] 
gh-121023: Improve `_xxtestfuzz/README.rst` (#121024)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
13 months agogh-124043: Disallow mixing `--with-trace-refs` and `--disable-gil` (#124078)
Peter Bierma [Mon, 16 Sep 2024 20:03:16 +0000 (16:03 -0400)] 
gh-124043: Disallow mixing `--with-trace-refs` and `--disable-gil` (#124078)

Tracing references is not currently thread-safe in the free-threaded build.

13 months agogh-124064: Make warning emitting compiler options opt-in (#124070)
Nate Ohlson [Mon, 16 Sep 2024 17:22:30 +0000 (12:22 -0500)] 
gh-124064: Make warning emitting compiler options opt-in (#124070)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
13 months agoGH-109975: Copyedit 3.13 What's New: New Deprecations (#123845)
Adam Turner [Mon, 16 Sep 2024 17:03:46 +0000 (18:03 +0100)] 
GH-109975: Copyedit 3.13 What's New: New Deprecations (#123845)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agogh-123969: refactor _PyErr_RaiseSyntaxError and _PyErr_EmitSyntaxWarning out of compi...
Irit Katriel [Mon, 16 Sep 2024 14:05:00 +0000 (15:05 +0100)] 
gh-123969: refactor _PyErr_RaiseSyntaxError and _PyErr_EmitSyntaxWarning out of compiler (#123972)

13 months agogh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive...
Irit Katriel [Mon, 16 Sep 2024 13:58:18 +0000 (14:58 +0100)] 
gh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive (#124061)

13 months agogh-97588: remove unused functions in _ctypes/cfield.c (GH-124010)
Irit Katriel [Mon, 16 Sep 2024 12:13:18 +0000 (13:13 +0100)] 
gh-97588: remove unused functions in _ctypes/cfield.c (GH-124010)

13 months agogh-123748: Add conditional compilation rules for HACL SIMD256 and SIMD128 on macOS...
Russell Keith-Magee [Mon, 16 Sep 2024 04:23:05 +0000 (12:23 +0800)] 
gh-123748: Add conditional compilation rules for HACL SIMD256 and SIMD128 on macOS (#123989)

Add conditional compilation rules to allow HACL SIMD256 and SIMD128 to be ignored on the ARM64 pass of universal2 macOS builds.

13 months agogh-121404: update CODEOWNERS (#124109)
Irit Katriel [Sun, 15 Sep 2024 19:21:22 +0000 (20:21 +0100)] 
gh-121404: update CODEOWNERS (#124109)

13 months agogh-121459: Add missing return to _PyDict_LoadGlobalStackRef (#124085)
Sam Gross [Sat, 14 Sep 2024 18:29:55 +0000 (14:29 -0400)] 
gh-121459: Add missing return to _PyDict_LoadGlobalStackRef (#124085)

We need to return immediately if there's an error during dictionary
lookup.

Also avoid the conditional-if operator. MSVC versions through v19.27 miscompile
compound literals with side effects within a conditional operator. This caused
crashes in the Windows10 buildbot.

13 months agoRemove unused `_allowed_types` from `typing.py` (#124090)
sobolevn [Sat, 14 Sep 2024 13:14:45 +0000 (16:14 +0300)] 
Remove unused `_allowed_types` from `typing.py` (#124090)