]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-106320: Remove _PyOS_ReadlineTState API (#107034)
Victor Stinner [Sat, 22 Jul 2023 14:45:56 +0000 (16:45 +0200)] 
gh-106320: Remove _PyOS_ReadlineTState API (#107034)

Remove _PyOS_ReadlineTState variable from the public C API.
The symbol is still exported for the readline shared extension.

2 years agogh-105090: Replace incorrect TLSv1.2 with TLSv1.3 (#105404)
Jocelyn Castellano [Sat, 22 Jul 2023 14:29:08 +0000 (10:29 -0400)] 
gh-105090: Replace incorrect TLSv1.2 with TLSv1.3 (#105404)

2 years agogh-106320: Move private _PyGen API to the internal C API (#107032)
Victor Stinner [Sat, 22 Jul 2023 14:21:16 +0000 (16:21 +0200)] 
gh-106320: Move private _PyGen API to the internal C API (#107032)

Move private _PyGen API to internal C API:

* _PyAsyncGenAThrow_Type
* _PyAsyncGenWrappedValue_Type
* _PyCoroWrapper_Type
* _PyGen_FetchStopIterationValue()
* _PyGen_Finalize()
* _PyGen_SetStopIterationValue()

No longer these symbols, except of the ones by the _asyncio shared
extensions.

2 years agogh-106320: Move _PyNone_Type to the internal C API (#107030)
Victor Stinner [Sat, 22 Jul 2023 14:12:17 +0000 (16:12 +0200)] 
gh-106320: Move _PyNone_Type to the internal C API (#107030)

Move private types _PyNone_Type and _PyNotImplemented_Type to
internal C API.

2 years agogh-106320: Move private _PyHash API to the internal C API (#107026)
Victor Stinner [Sat, 22 Jul 2023 13:49:37 +0000 (15:49 +0200)] 
gh-106320: Move private _PyHash API to the internal C API (#107026)

* No longer export most private _PyHash symbols, only export the ones
  which are needed by shared extensions.
* Modules/_xxtestfuzz/fuzzer.c now uses the internal C API.

2 years agogh-106320: Document private C API removal in What's New 3.13 (#107027)
Victor Stinner [Sat, 22 Jul 2023 13:30:13 +0000 (15:30 +0200)] 
gh-106320: Document private C API removal in What's New 3.13 (#107027)

2 years agogh-69714: Make `calendar` module fully tested (#93655)
Bart Skowron [Sat, 22 Jul 2023 13:20:40 +0000 (15:20 +0200)] 
gh-69714: Make `calendar` module fully tested (#93655)

There are 3 paths to use `locale` argument in
`calendar.Locale{Text|HTML}Calendar.__init__(..., locale=None)`:
(1) `locale=None` -- denotes the "default locale"[1]
(2) `locale=""` -- denotes the native environment
(3) `locale=other_valid_locale` -- denotes a custom locale

So far case (2) is covered and case (1) is in 78935daf5a (same branch).
This commit adds a remaining case (3).

[1] In the current implementation, this translates into the following
approach:

GET current locale
IF current locale == "C" THEN
  SET current locale TO ""
  GET current locale
ENDIF

* Remove unreachable code (and increase test coverage)

This condition cannot be true. `_locale.setlocale()` from the C module
raises `locale.Error` instead of returning `None` for
`different_locale.__enter__` (where `self.oldlocale` is set).

* Expand the try clause to calls to `LocaleTextCalendar.formatmonthname()`.

This method temporarily changes the current locale to the given locale,
so `_locale.setlocale()` may raise `local.Error`.

Co-authored-by: Rohit Mediratta <rohitm@gmail.com>
Co-authored-by: Jessica McKellar <jesstess@mit.edu>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2 years agogh-106320: Remove private _PyUnicode_AsString() alias (#107021)
Victor Stinner [Sat, 22 Jul 2023 13:15:05 +0000 (15:15 +0200)] 
gh-106320: Remove private _PyUnicode_AsString() alias (#107021)

Remove private _PyUnicode_AsString() alias to PyUnicode_AsUTF8(). It
was kept for backward compatibility with Python 3.0 - 3.2.

The PyUnicode_AsUTF8() is available since Python
3.3. The PyUnicode_AsUTF8String() function can be used to keep
compatibility with Python 3.2 and older.

2 years agogh-106989: Remove tok report warnings (#106993)
Menelaos Kotoglou [Sat, 22 Jul 2023 12:23:23 +0000 (15:23 +0300)] 
gh-106989: Remove tok report warnings (#106993)

2 years agogh-105699: Add some stress tests for subinterpreter creation (#106966)
Eric Snow [Sat, 22 Jul 2023 12:21:55 +0000 (06:21 -0600)] 
gh-105699: Add some stress tests for subinterpreter creation (#106966)

2 years agoReformat code block to make it easier to read (#106965)
Joe Kaufeld [Sat, 22 Jul 2023 12:19:30 +0000 (08:19 -0400)] 
Reformat code block to make it easier to read (#106965)

2 years agogh-106714: Fix test_capi to not write a coredump (#107007)
Victor Stinner [Sat, 22 Jul 2023 12:17:25 +0000 (14:17 +0200)] 
gh-106714: Fix test_capi to not write a coredump (#107007)

test_capi: Fix test_no_FatalError_infinite_loop() to no longer write
a coredump, by using test.support.SuppressCrashReport.

2 years agogh-106969: Indicate no modules were added in 3.10 & 3.12 (#106988)
Sebastiaan Zeeff [Sat, 22 Jul 2023 12:13:44 +0000 (14:13 +0200)] 
gh-106969: Indicate no modules were added in 3.10 & 3.12 (#106988)

The "New Modules" section was left in place to ensure that the anchor
link for new modules will still exist:

/whatsnew/3.12.html#new-modules
/whatsnew/3.10.html#new-modules

This means that existing links to this section don't break.

2 years agogh-104050: Argument Clinic: Annotate the BufferSeries class (#106935)
Erlend E. Aasland [Sat, 22 Jul 2023 10:46:42 +0000 (12:46 +0200)] 
gh-104050: Argument Clinic: Annotate the BufferSeries class (#106935)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-106996: Amend the introduction to the turtle graphics documentation (#106997)
Daniele Procida [Sat, 22 Jul 2023 10:31:44 +0000 (12:31 +0200)] 
gh-106996: Amend the introduction to the turtle graphics documentation (#106997)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106978: Bump sphinx-lint to 0.6.8 (#106990)
Sven Arends [Sat, 22 Jul 2023 09:38:47 +0000 (11:38 +0200)] 
gh-106978: Bump sphinx-lint to 0.6.8 (#106990)

2 years agogh-106368: Increase coverage for Argument Clinic output directive (#106979)
Erlend E. Aasland [Sat, 22 Jul 2023 09:32:10 +0000 (11:32 +0200)] 
gh-106368: Increase coverage for Argument Clinic output directive (#106979)

2 years agogh-106976:alphabetise bullets by module name task1 (#106982)
littlebutt's workshop [Sat, 22 Jul 2023 08:34:48 +0000 (08:34 +0000)] 
gh-106976:alphabetise bullets by module name task1 (#106982)

2 years agogh-106973: Change non-integral to non-integer in "3.12 What's New" (#106984)
Sebastiaan Zeeff [Sat, 22 Jul 2023 08:27:48 +0000 (10:27 +0200)] 
gh-106973: Change non-integral to non-integer in "3.12 What's New" (#106984)

2 years agogh-101100: Docs: Check Sphinx warnings and fail if improved (#106460)
Hugo van Kemenade [Sat, 22 Jul 2023 08:12:43 +0000 (10:12 +0200)] 
gh-101100: Docs: Check Sphinx warnings and fail if improved (#106460)

2 years agogh-106970: Fix Argument Clinic 'destination <name> clear' command (#106972)
Erlend E. Aasland [Sat, 22 Jul 2023 07:43:13 +0000 (09:43 +0200)] 
gh-106970: Fix Argument Clinic 'destination <name> clear' command (#106972)

Add test for the 'destination <name> clear' command,
and the 'destination' directive in general.

Fix two bugs in 'destination <name> clear' command:

1. The text attribute of the allocator is called 'text', not '_text'
2. Return after processing the 'clear' command,
   instead of proceeding directly to the fail().

2 years agogh-96663: Add a better error message for __dict__-less classes setattr (#103232)
James Hilton-Balfe [Sat, 22 Jul 2023 00:24:26 +0000 (01:24 +0100)] 
gh-96663: Add a better error message for __dict__-less classes setattr (#103232)

2 years agogh-106004: Add PyDict_GetItemRef() function (#106005)
Victor Stinner [Fri, 21 Jul 2023 21:10:51 +0000 (23:10 +0200)] 
gh-106004: Add PyDict_GetItemRef() function (#106005)

* Add PyDict_GetItemRef() and PyDict_GetItemStringRef() functions.
  Add these functions to the stable ABI version 3.13.
* Add unit tests on the PyDict C API in test_capi.

2 years agogh-105699: Fix a Crasher Related to a Deprecated Global Variable (gh-106923)
Eric Snow [Fri, 21 Jul 2023 14:34:09 +0000 (08:34 -0600)] 
gh-105699: Fix a Crasher Related to a Deprecated Global Variable (gh-106923)

There was a slight race in _Py_ClearFileSystemEncoding() (when called from _Py_SetFileSystemEncoding()), between freeing the value and setting the variable to NULL, which occasionally caused crashes when multiple isolated interpreters were used.  (Notably, I saw at least 10 different, seemingly unrelated spooky-action-at-a-distance, ways this crashed. Yay, free threading!)  We avoid the problem by only setting the global variables with the main interpreter (i.e. runtime init).

2 years agogh-105699: Fix an Interned Strings Crasher (gh-106930)
Eric Snow [Fri, 21 Jul 2023 14:32:42 +0000 (08:32 -0600)] 
gh-105699: Fix an Interned Strings Crasher (gh-106930)

A static (process-global) str object must only have its "interned" state cleared when no longer interned in any interpreters.  They are the only ones that can be shared by interpreters so we don't have to worry about any other str objects.

We trigger clearing the state with the main interpreter, since no other interpreters may exist at that point and _PyUnicode_ClearInterned() is only called during interpreter finalization.

We do not address here the fact that a string will only be interned in the first interpreter that interns it.  In any subsequent interpreters str.state.interned is already set so _PyUnicode_InternInPlace() will skip it.  That needs to be addressed separately from fixing the crasher.

2 years agogh-106847: Add -X warn_default_encoding in sys.flags Doc (#106854)
qqwqqw689 [Fri, 21 Jul 2023 10:17:58 +0000 (18:17 +0800)] 
gh-106847: Add -X warn_default_encoding in sys.flags Doc (#106854)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agogh-106909: Use role :const: for referencing module constants (GH-106910)
Serhiy Storchaka [Fri, 21 Jul 2023 09:40:37 +0000 (12:40 +0300)] 
gh-106909: Use role :const: for referencing module constants (GH-106910)

2 years agogh-106892: Use roles :data: and :const: for referencing module variables (GH-106894)
Serhiy Storchaka [Fri, 21 Jul 2023 09:34:30 +0000 (12:34 +0300)] 
gh-106892: Use roles :data: and :const: for referencing module variables (GH-106894)

2 years agogh-47146: Fix reference counting in _testcapi.structmember initializer (GH-106862)
Serhiy Storchaka [Fri, 21 Jul 2023 09:30:14 +0000 (12:30 +0300)] 
gh-47146: Fix reference counting in _testcapi.structmember initializer (GH-106862)

2 years agogh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920)
Serhiy Storchaka [Fri, 21 Jul 2023 07:52:07 +0000 (10:52 +0300)] 
gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920)

2 years agoDocs: Argument Clinic: Add Background and Tutorial top-level sections (#106904)
Erlend E. Aasland [Fri, 21 Jul 2023 06:05:41 +0000 (08:05 +0200)] 
Docs: Argument Clinic: Add Background and Tutorial top-level sections (#106904)

Add Background as a toplevel section with the following subsections:

- Background
  - The goals of Argument Clinic
  - Basic concepts and usage

Rename "Converting your first function" to Tutorial.

Add anchors for Background, Tutorial, and How-to Guides:

- :ref:`clinic-background`
- :ref:`clinic-tutorial`
- :ref:`clinic-howtos`

Link to these from within the Abstract.

Break the compatibility paragraph out of Abstract and make it a note.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2 years agogh-106368: Increase Argument Clinic test coverage for IndentStack (#106933)
Erlend E. Aasland [Fri, 21 Jul 2023 06:02:39 +0000 (08:02 +0200)] 
gh-106368: Increase Argument Clinic test coverage for IndentStack (#106933)

2 years agogh-106916: Add missing error check _PyCompile_CleanDoc (#106921)
Kirill Podoprigora [Fri, 21 Jul 2023 04:56:58 +0000 (07:56 +0300)] 
gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-106669: Revert "gh-102988: Detect email address parsing errors ... (#105127)"...
Gregory P. Smith [Fri, 21 Jul 2023 03:30:52 +0000 (20:30 -0700)] 
gh-106669: Revert "gh-102988: Detect email address parsing errors ... (#105127)" (#106733)

This reverts commit 18dfbd035775c15533d13a98e56b1d2bf5c65f00.
Adds a regression test from the issue.

See https://github.com/python/cpython/issues/106669.

2 years agogh-104050: Argument Clinic: Annotate the IndentStack class (#106934)
Erlend E. Aasland [Thu, 20 Jul 2023 23:19:11 +0000 (01:19 +0200)] 
gh-104050: Argument Clinic: Annotate the IndentStack class (#106934)

2 years agogh-105540: Show source files relative to root (#106927)
Guido van Rossum [Thu, 20 Jul 2023 23:08:52 +0000 (16:08 -0700)] 
gh-105540: Show source files relative to root (#106927)

This restores a corner case: when the generator is run with working directory set to Tools/cases_generator, the source filenames listed in the generated provenance header should be relative to the repo root directory.

2 years agoFix typo in tkinter docs (#106936)
Makonede [Thu, 20 Jul 2023 23:07:06 +0000 (16:07 -0700)] 
Fix typo in tkinter docs (#106936)

Signed-off-by: Makonede <61922615+Makonede@users.noreply.github.com>
2 years agogh-104050: Argument Clinic: Increase CConverter typing coverage (#106932)
Erlend E. Aasland [Thu, 20 Jul 2023 22:45:02 +0000 (00:45 +0200)] 
gh-104050: Argument Clinic: Increase CConverter typing coverage (#106932)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-104050: Argument Clinic: Annotate CLanguage.render_option_group_parsing() (#106929)
Erlend E. Aasland [Thu, 20 Jul 2023 21:33:33 +0000 (23:33 +0200)] 
gh-104050: Argument Clinic: Annotate CLanguage.render_option_group_parsing() (#106929)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-106701: Move _PyUopExecute to Python/executor.c (GH-106924)
Brandt Bucher [Thu, 20 Jul 2023 20:37:19 +0000 (13:37 -0700)] 
GH-106701: Move _PyUopExecute to Python/executor.c (GH-106924)

2 years agogh-105481: do not auto-generate pycore_intrinsics.h (#106913)
Irit Katriel [Thu, 20 Jul 2023 16:46:04 +0000 (17:46 +0100)] 
gh-105481: do not auto-generate pycore_intrinsics.h (#106913)

2 years agoGH-104584: Miscellaneous fixes for -Xuops (GH-106908)
Brandt Bucher [Thu, 20 Jul 2023 16:35:39 +0000 (09:35 -0700)] 
GH-104584: Miscellaneous fixes for -Xuops (GH-106908)

2 years agoFix typo in 3.11.4 changelog: urllib.request.Requst -> Request (#106830)
Zach Brantmeier [Thu, 20 Jul 2023 09:28:21 +0000 (04:28 -0500)] 
Fix typo in 3.11.4 changelog: urllib.request.Requst -> Request (#106830)

2 years agogh-106078: Prepare to isolate decimal module (#106880)
Charlie Zhao [Thu, 20 Jul 2023 09:24:35 +0000 (17:24 +0800)] 
gh-106078: Prepare to isolate decimal module (#106880)

* move signal_map to global_state

* move cond_map to global_state

2 years agogh-102799: use sys.exception() instead of sys.exc_info() in contextlib (#103311)
Irit Katriel [Thu, 20 Jul 2023 09:11:32 +0000 (10:11 +0100)] 
gh-102799: use sys.exception() instead of sys.exc_info() in contextlib (#103311)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agogh-106751: Optimize _PolllikeSelector for many iteration case (gh-106884)
Pieter Eendebak [Thu, 20 Jul 2023 00:53:11 +0000 (02:53 +0200)] 
gh-106751: Optimize _PolllikeSelector for many iteration case (gh-106884)

2 years agogh-106882: Note that `asyncio.Server` is only publicly exposed on 3.11+ (#106901)
Jack Nelson [Wed, 19 Jul 2023 19:56:26 +0000 (15:56 -0400)] 
gh-106882: Note that `asyncio.Server` is only publicly exposed on 3.11+ (#106901)

And later versions of 3.10, 3.9

2 years agoGH-100502: Add `pathlib.PurePath.pathmod` attribute (GH-106533)
Barney Gale [Wed, 19 Jul 2023 17:59:55 +0000 (18:59 +0100)] 
GH-100502: Add `pathlib.PurePath.pathmod` attribute (GH-106533)

This instance attribute stores the implementation of `os.path` used for
low-level path operations: either `posixpath` or `ntpath`.

2 years agoExport _PyEval_SetProfile() as a function, not data (#106887)
Victor Stinner [Wed, 19 Jul 2023 11:07:40 +0000 (13:07 +0200)] 
Export _PyEval_SetProfile() as a function, not data (#106887)

2 years agogh-104090: Fix unittest collectedDurations resources leak (#106795)
Yonatan Bitton [Wed, 19 Jul 2023 11:03:47 +0000 (14:03 +0300)] 
gh-104090: Fix unittest collectedDurations resources leak (#106795)

2 years agogh-106751: Optimize SelectSelector.select() for many iteration case (gh-106879)
Dong-hee Na [Wed, 19 Jul 2023 06:12:38 +0000 (15:12 +0900)] 
gh-106751: Optimize SelectSelector.select() for many iteration case (gh-106879)

2 years agogh-106751: Optimize KqueueSelector.select() for many iteration case (gh-106864)
Dong-hee Na [Wed, 19 Jul 2023 01:18:23 +0000 (10:18 +0900)] 
gh-106751: Optimize KqueueSelector.select() for many iteration case (gh-106864)

2 years agogh-106727: Make `inspect.getsource` smarter for class for same name definitions ...
Tian Gao [Tue, 18 Jul 2023 23:20:31 +0000 (15:20 -0800)] 
gh-106727: Make `inspect.getsource` smarter for class for same name definitions (#106815)

2 years agoDocs: Argument Clinic: Group guides about default values (#106872)
Erlend E. Aasland [Tue, 18 Jul 2023 22:46:50 +0000 (00:46 +0200)] 
Docs: Argument Clinic: Group guides about default values (#106872)

Previous ToC layout (excerpt):

    - How to use symbolic default values
    ...
    - How to assign default values to parameter
      - How to use the ``NULL`` default value
      - How to use expressions as default values

New layout:

    - How to assign default values to parameter
      - The ``NULL`` default value
      - Symbolic default values
      - Expressions as default values

2 years agogh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860)
Serhiy Storchaka [Tue, 18 Jul 2023 20:59:53 +0000 (23:59 +0300)] 
gh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860)

2 years agogh-105481: Generate the opcode lists in dis from data extracted from bytecodes.c...
Irit Katriel [Tue, 18 Jul 2023 18:42:44 +0000 (19:42 +0100)] 
gh-105481: Generate the opcode lists in dis from data extracted from bytecodes.c (#106758)

2 years agogh-106535: Document soft deprecations in What's New In Python 3.13 (#106859)
Victor Stinner [Tue, 18 Jul 2023 15:13:51 +0000 (17:13 +0200)] 
gh-106535: Document soft deprecations in What's New In Python 3.13 (#106859)

2 years agogh-106751: selectors: optimize EpollSelector.select() (#106754)
J. Nick Koston [Tue, 18 Jul 2023 10:16:32 +0000 (00:16 -1000)] 
gh-106751: selectors: optimize EpollSelector.select() (#106754)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2 years agoDocs: Normalise Argument Clinic advanced topics headings (#106842)
Erlend E. Aasland [Tue, 18 Jul 2023 08:50:17 +0000 (10:50 +0200)] 
Docs: Normalise Argument Clinic advanced topics headings (#106842)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2 years agogh-86493: Fix possible leaks in some modules initialization (GH-106768)
Serhiy Storchaka [Tue, 18 Jul 2023 07:50:47 +0000 (10:50 +0300)] 
gh-86493: Fix possible leaks in some modules initialization (GH-106768)

Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.

2 years agobpo-42327: C API: Add PyModule_Add() function (GH-23443)
Serhiy Storchaka [Tue, 18 Jul 2023 06:42:05 +0000 (09:42 +0300)] 
bpo-42327: C API: Add PyModule_Add() function (GH-23443)

It is a fixed implementation of PyModule_AddObject() which consistently
steals reference both on success and on failure.

2 years agogh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal,...
Serhiy Storchaka [Tue, 18 Jul 2023 06:00:22 +0000 (09:00 +0300)] 
gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767)

2 years agogh-106719: Fix __annotations__ getter and setter in the type and module types (GH...
Serhiy Storchaka [Tue, 18 Jul 2023 05:56:58 +0000 (08:56 +0300)] 
gh-106719: Fix __annotations__ getter and setter in the type and module types (GH-106720)

No longer suppress arbitrary errors. Simplify the code.

2 years agogh-106843: fix memleak in _PyCompile_CleanDoc (#106846)
Inada Naoki [Tue, 18 Jul 2023 03:44:16 +0000 (12:44 +0900)] 
gh-106843: fix memleak in _PyCompile_CleanDoc (#106846)

2 years agoSmall fixes to code generator (#106845)
Guido van Rossum [Tue, 18 Jul 2023 01:30:41 +0000 (18:30 -0700)] 
Small fixes to code generator (#106845)

These repair nits I found in PR gh-106798 (issue gh-106797) and in PR gh-106716 (issue gh-106706).

2 years agogh-104683: Argument Clinic: Modernise parse_special_symbol() (#106837)
Erlend E. Aasland [Mon, 17 Jul 2023 22:37:11 +0000 (00:37 +0200)] 
gh-104683: Argument Clinic: Modernise parse_special_symbol() (#106837)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoAdd Erlend as CODEOWNER for Argument Clinic docs (#106840)
Erlend E. Aasland [Mon, 17 Jul 2023 22:10:03 +0000 (00:10 +0200)] 
Add Erlend as CODEOWNER for Argument Clinic docs (#106840)

2 years agogh-106368: Increase Argument Clinic test coverage for cpp.Monitor (#106833)
Erlend E. Aasland [Mon, 17 Jul 2023 20:55:10 +0000 (22:55 +0200)] 
gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (#106833)

2 years agogh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (#106832)
Nikita Sobolev [Mon, 17 Jul 2023 19:55:40 +0000 (22:55 +0300)] 
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (#106832)

2 years agogh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794)
Guido van Rossum [Mon, 17 Jul 2023 19:12:33 +0000 (12:12 -0700)] 
gh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794)

2 years agogh-61215: threadingmock: Improve test suite to avoid race conditions (#106822)
Mario Corchero [Mon, 17 Jul 2023 18:57:40 +0000 (20:57 +0200)] 
gh-61215: threadingmock: Improve test suite to avoid race conditions (#106822)

threadingmock: Improve test suite to avoid race conditions

Simplify tests and split them into multiple tests to prevent assertions
from triggering race conditions.
Additionally, we rely on calling the mocks without delay to validate the
functionality of matching calls.

2 years agogh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` (#106707)
Guido van Rossum [Mon, 17 Jul 2023 18:02:58 +0000 (11:02 -0700)] 
gh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` (#106707)

By turning `assert(kwnames == NULL)` into a macro that is not in the "forbidden" list, many instructions that formerly were skipped because they contained such an assert (but no other mention of `kwnames`) are now supported in Tier 2. This covers 10 instructions in total (all specializations of `CALL` that invoke some C code):
- `CALL_NO_KW_TYPE_1`
- `CALL_NO_KW_STR_1`
- `CALL_NO_KW_TUPLE_1`
- `CALL_NO_KW_BUILTIN_O`
- `CALL_NO_KW_BUILTIN_FAST`
- `CALL_NO_KW_LEN`
- `CALL_NO_KW_ISINSTANCE`
- `CALL_NO_KW_METHOD_DESCRIPTOR_O`
- `CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS`
- `CALL_NO_KW_METHOD_DESCRIPTOR_FAST`

2 years agogh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE (#106796)
Guido van Rossum [Mon, 17 Jul 2023 17:06:05 +0000 (10:06 -0700)] 
gh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE (#106796)

These aren't automatically translated because (ironically)
they are macros deferring to POP_JUMP_IF_{TRUE,FALSE},
which are not viable uops (being manually translated).

The hack is that we emit IS_NONE and then set opcode and
jump to the POP_JUMP_IF_{TRUE,FALSE} translation code.

2 years agogh-106687: _ssl: use uint64_t for SSL options (#106700)
Victor Stinner [Mon, 17 Jul 2023 15:55:30 +0000 (17:55 +0200)] 
gh-106687: _ssl: use uint64_t for SSL options (#106700)

SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html

Fix this compiler warning on Windows with MSC:

    conversion from 'uint64_t' to 'long', possible loss of data

2 years agogh-104050: Improve Argument Clinic type annotation coverage (#106810)
Erlend E. Aasland [Mon, 17 Jul 2023 11:47:08 +0000 (13:47 +0200)] 
gh-104050: Improve Argument Clinic type annotation coverage (#106810)

Add various missing annotations in the following classes:
- BlockPrinter
- CConverter
- CLanguage
- FormatCounterFormatter
- Language
- _TextAccumulator

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-106789: avoid importing pprint from sysconfig (#106790)
Irit Katriel [Mon, 17 Jul 2023 09:28:33 +0000 (10:28 +0100)] 
gh-106789: avoid importing pprint from sysconfig (#106790)

2 years agogh-106780: Add __match_args__ to tutorial example (#106784)
Terry Jan Reedy [Mon, 17 Jul 2023 03:36:03 +0000 (23:36 -0400)] 
gh-106780: Add __match_args__ to tutorial example (#106784)

Add Point definition with this attribute before example
that needs it.

2 years agoAdd more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817)
Raymond Hettinger [Mon, 17 Jul 2023 02:37:07 +0000 (21:37 -0500)] 
Add more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817)

2 years agogh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798)
Dong-hee Na [Mon, 17 Jul 2023 00:09:11 +0000 (09:09 +0900)] 
gh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798)

2 years agogh-104050: Argument Clinic: Annotate Clinic.parse() (#106760)
Erlend E. Aasland [Mon, 17 Jul 2023 00:04:10 +0000 (02:04 +0200)] 
gh-104050: Argument Clinic: Annotate Clinic.parse() (#106760)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-105540: Convert `pytest` tests of `cases_generator` to regular tests (#106713)
Nikita Sobolev [Sun, 16 Jul 2023 23:05:24 +0000 (02:05 +0300)] 
gh-105540: Convert `pytest` tests of `cases_generator` to regular tests (#106713)

2 years agoFix the french used in the email documentation (GH-106279)
Jean-Baptiste Poupon [Sun, 16 Jul 2023 17:14:08 +0000 (20:14 +0300)] 
Fix the french used in the email documentation (GH-106279)

* Fix the french used in the email documentation

The french used in one of the example was either machine translated a while ago or written by someone who does not speak french. Fixed it by using grammatically correct french.

2 years agogh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManag...
Grigoriev Semyon [Sun, 16 Jul 2023 15:30:39 +0000 (18:30 +0300)] 
gh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManager` (#106771)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agogh-106706: Streamline family syntax in cases generator DSL (#106716)
Kevin Diem [Sun, 16 Jul 2023 15:16:34 +0000 (11:16 -0400)] 
gh-106706: Streamline family syntax in cases generator DSL (#106716)

From `family(opname, STRUCTSIZE) = OPNAME + SPEC1 + ... +  SPECn;`
to `family(OPNAME, STRUCTSIZE) = SPEC1 + ... + SPECn;`

2 years agoDoc: fix section levels of devmode doc (#106801)
Inada Naoki [Sun, 16 Jul 2023 12:23:54 +0000 (21:23 +0900)] 
Doc: fix section levels of devmode doc (#106801)

2 years agoDoc: devmode: add -Xdev option to example (#106253)
Simone Rubino [Sun, 16 Jul 2023 07:29:58 +0000 (09:29 +0200)] 
Doc: devmode: add -Xdev option to example (#106253)

2 years agoDocs search: Replace jQuery with vanilla JavaScript (#106743)
Hugo van Kemenade [Sun, 16 Jul 2023 07:26:26 +0000 (10:26 +0300)] 
Docs search: Replace jQuery with vanilla JavaScript (#106743)

* Replace jQuery with vanilla JavaScript
* Switch 'var' to 'const' or 'let'

2 years agoDocs: Normalize Argument Clinic How-To section capitalization (#106788)
Erlend E. Aasland [Sat, 15 Jul 2023 22:42:58 +0000 (00:42 +0200)] 
Docs: Normalize Argument Clinic How-To section capitalization (#106788)

2 years agofaq/library: remove outdated section (#105996)
Mathieu Dupuy [Sat, 15 Jul 2023 20:23:10 +0000 (22:23 +0200)] 
faq/library: remove outdated section (#105996)

2 years agoAdd more examples to the recipe docs (GH-106782)
Raymond Hettinger [Sat, 15 Jul 2023 19:43:09 +0000 (14:43 -0500)] 
Add more examples to the recipe docs (GH-106782)

Demonstrate that factor() works for large composites and large primes.

2 years agogh-106752: Sync with zipp 3.16.2 (#106757)
Jason R. Coombs [Sat, 15 Jul 2023 13:21:17 +0000 (09:21 -0400)] 
gh-106752: Sync with zipp 3.16.2 (#106757)

* gh-106752: Sync with zipp 3.16.2

* Add blurb

2 years agogh-81283: compiler: remove indent from docstring (#106411)
Inada Naoki [Sat, 15 Jul 2023 10:33:32 +0000 (19:33 +0900)] 
gh-81283: compiler: remove indent from docstring (#106411)

Co-authored-by: Éric <merwok@netwok.org>
2 years agogh-104050: Argument Clinic: Annotate BlockParser (#106750)
Erlend E. Aasland [Sat, 15 Jul 2023 10:11:32 +0000 (12:11 +0200)] 
gh-104050: Argument Clinic: Annotate BlockParser (#106750)

2 years agogh-106368: Increase Argument Clinic BlockParser test coverage (#106759)
Erlend E. Aasland [Sat, 15 Jul 2023 09:28:57 +0000 (11:28 +0200)] 
gh-106368: Increase Argument Clinic BlockParser test coverage (#106759)

2 years agogh-106529: Fix subtle Tier 2 edge case with list iterator (#106756)
Guido van Rossum [Sat, 15 Jul 2023 00:22:06 +0000 (17:22 -0700)] 
gh-106529: Fix subtle Tier 2 edge case with list iterator (#106756)

The Tier 2 opcode _IS_ITER_EXHAUSTED_LIST (and _TUPLE)
didn't set it->it_seq to NULL, causing a subtle bug
that resulted in test_exhausted_iterator in list_tests.py
to fail when running all tests with -Xuops.

The bug was introduced in gh-106696.

Added this as an explicit test.

Also fixed the dependencies for ceval.o -- it depends on executor_cases.c.h.

2 years agogh-106752: Move zipfile._path into its own package (#106753)
Jason R. Coombs [Fri, 14 Jul 2023 20:40:46 +0000 (16:40 -0400)] 
gh-106752: Move zipfile._path into its own package (#106753)

* gh-106752: Move zipfile._path into its own package so it may have supplementary behavior.

* Add blurb

2 years agogh-102799: replace internal sys.exc_info() call by sys.exception() (#106746)
Irit Katriel [Fri, 14 Jul 2023 19:41:24 +0000 (20:41 +0100)] 
gh-102799: replace internal sys.exc_info() call by sys.exception() (#106746)

2 years agogh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently...
Alex Waygood [Fri, 14 Jul 2023 18:49:02 +0000 (19:49 +0100)] 
gh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently planned (#106748)

2 years agogh-106554: replace `_BaseSelectorImpl._key_from_fd` with `dict.get` (#106555)
J. Nick Koston [Fri, 14 Jul 2023 18:46:30 +0000 (08:46 -1000)] 
gh-106554: replace `_BaseSelectorImpl._key_from_fd` with `dict.get` (#106555)

2 years agogh-105481: expose opcode metadata via the _opcode module (#106688)
Irit Katriel [Fri, 14 Jul 2023 17:41:52 +0000 (18:41 +0100)] 
gh-105481: expose opcode metadata via the _opcode module (#106688)