]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-106922: Fix error location for constructs with spaces and parentheses (#108959)
Pablo Galindo Salgado [Fri, 8 Sep 2023 16:18:35 +0000 (17:18 +0100)] 
gh-106922: Fix error location for constructs with spaces and parentheses (#108959)

2 years agogh-109140: Rename duplicated tests in `test_binascii` (#109141)
Hugo van Kemenade [Fri, 8 Sep 2023 15:30:28 +0000 (09:30 -0600)] 
gh-109140: Rename duplicated tests in `test_binascii` (#109141)

2 years agogh-104690: thread_run() checks for tstate dangling pointer (#109056)
Victor Stinner [Fri, 8 Sep 2023 09:50:46 +0000 (11:50 +0200)] 
gh-104690: thread_run() checks for tstate dangling pointer (#109056)

thread_run() of _threadmodule.c now calls
_PyThreadState_CheckConsistency() to check if tstate is a dangling
pointer when Python is built in debug mode.

Rename ceval_gil.c is_tstate_valid() to
_PyThreadState_CheckConsistency() to reuse it in _threadmodule.c.

2 years agoGH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)
Victor Stinner [Fri, 8 Sep 2023 09:48:28 +0000 (11:48 +0200)] 
GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)

Symbols of the C API should be prefixed by "Py_" to avoid conflict
with existing names in 3rd party C extensions on "#include <Python.h>".

test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other
_testcapi and _testinternalcapi constants.

2 years agoGH-108716: Turn off deep-freezing of code objects. (GH-108722)
Mark Shannon [Fri, 8 Sep 2023 09:34:40 +0000 (10:34 +0100)] 
GH-108716: Turn off deep-freezing of code objects. (GH-108722)

2 years agoUpdate `CODEOWNERS` for `Tools/wasm/` (#109119)
Brett Cannon [Fri, 8 Sep 2023 05:37:29 +0000 (22:37 -0700)] 
Update `CODEOWNERS` for `Tools/wasm/` (#109119)

2 years agogh-109022: [Enum] require `names=()` to create empty enum type (GH-109048)
Ethan Furman [Fri, 8 Sep 2023 01:19:03 +0000 (18:19 -0700)] 
gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048)

add guard so that ``Enum('bar')`` raises a TypeError instead of
creating a new enum class called `bar`.  To create the new but
empty class, use:

    huh = Enum('bar', names=())

2 years agoUse unittest test runner for doctests in test_statistics (GH-108921)
Serhiy Storchaka [Thu, 7 Sep 2023 20:08:55 +0000 (23:08 +0300)] 
Use unittest test runner for doctests in test_statistics (GH-108921)

2 years agoAdd version directives to ast docs (#108788)
Shantanu [Thu, 7 Sep 2023 18:34:18 +0000 (11:34 -0700)] 
Add version directives to ast docs (#108788)

2 years agogh-68403: Fix test_coverage in test_trace (GH-108910)
Serhiy Storchaka [Thu, 7 Sep 2023 18:28:18 +0000 (21:28 +0300)] 
gh-68403: Fix test_coverage in test_trace (GH-108910)

Its behavior no longer affected by test running options such as -m.

2 years agogh-75743: Restore test_timeout.testConnectTimeout() (#109087)
Ee Durbin [Thu, 7 Sep 2023 18:13:32 +0000 (14:13 -0400)] 
gh-75743: Restore test_timeout.testConnectTimeout() (#109087)

This un-skips this test now that pythontest.net implements appropriate firewall
rules for it.

2 years agogh-103186: Make test_generated_cases less noisy by default (GH-109100)
Serhiy Storchaka [Thu, 7 Sep 2023 17:53:38 +0000 (20:53 +0300)] 
gh-103186: Make test_generated_cases less noisy by default (GH-109100)

Print additional details only when tests are run with -vv.

2 years agogh-109094: remove unnecessary updates of frame->prev_instr in instrumentation functio...
Irit Katriel [Thu, 7 Sep 2023 17:23:11 +0000 (18:23 +0100)] 
gh-109094: remove unnecessary updates of frame->prev_instr in instrumentation functions (#109076)

2 years agogh-107924: re-order os.sendfile() flag documentation (#107926)
Christoph Anton Mitterer [Thu, 7 Sep 2023 15:50:10 +0000 (17:50 +0200)] 
gh-107924: re-order os.sendfile() flag documentation (#107926)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-108732: include comprehension locals in frame.f_locals (#109026)
Carl Meyer [Thu, 7 Sep 2023 14:56:43 +0000 (08:56 -0600)] 
gh-108732: include comprehension locals in frame.f_locals (#109026)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-102823: Document return type of floor division on floats (#102824)
Mark Dickinson [Thu, 7 Sep 2023 14:20:33 +0000 (15:20 +0100)] 
gh-102823: Document return type of floor division on floats (#102824)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-88943: Improve syntax error for non-ASCII character that follows a numerical liter...
Serhiy Storchaka [Thu, 7 Sep 2023 14:00:13 +0000 (17:00 +0300)] 
gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081)

It now points on the invalid non-ASCII character, not on the valid numerical literal.

2 years agogh-107544: Add docs about `json.dumps(..., default=)` (#108259)
Nikita Sobolev [Thu, 7 Sep 2023 13:53:33 +0000 (16:53 +0300)] 
gh-107544: Add docs about `json.dumps(..., default=)` (#108259)

2 years agogh-71770: Add more details on behavior of configparser's default_section (#31562)
Stanley [Thu, 7 Sep 2023 13:52:58 +0000 (06:52 -0700)] 
gh-71770: Add more details on behavior of configparser's default_section (#31562)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoGH-108614: Add `RESUME_CHECK` instruction (GH-108630)
Mark Shannon [Thu, 7 Sep 2023 13:39:03 +0000 (14:39 +0100)] 
GH-108614: Add `RESUME_CHECK` instruction (GH-108630)

2 years agogh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace...
Serhiy Storchaka [Thu, 7 Sep 2023 13:34:44 +0000 (16:34 +0300)] 
gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075)

2 years agogh-103186: Remove debug print in test_sys_settrace (GH-109077)
Serhiy Storchaka [Thu, 7 Sep 2023 13:30:41 +0000 (16:30 +0300)] 
gh-103186: Remove debug print in test_sys_settrace (GH-109077)

2 years agoGH-90915: Document that SystemExit doesn't trigger sys.excepthook (#31357)
Colin Watson [Thu, 7 Sep 2023 13:14:27 +0000 (14:14 +0100)] 
GH-90915: Document that SystemExit doesn't trigger sys.excepthook (#31357)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agosocket documentation fix - rename triple to 3-tuple (#24722)
Ori Hoch [Thu, 7 Sep 2023 10:33:02 +0000 (13:33 +0300)] 
socket documentation fix - rename triple to 3-tuple (#24722)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agobpo-38157: Add example about per file output for mock_open. (#16090)
Karthikeyan Singaravelan [Thu, 7 Sep 2023 09:19:13 +0000 (14:49 +0530)] 
bpo-38157: Add example about per file output for mock_open. (#16090)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-103186: Suppress and assert expected RuntimeWarnings in test_sys_settrace (GH...
Ijtaba Hussain [Thu, 7 Sep 2023 07:41:38 +0000 (12:41 +0500)] 
gh-103186: Suppress and assert expected RuntimeWarnings in test_sys_settrace (GH-103244)

Caused as a result of frame manipulation where locals are never assigned / initialised.

2 years agotest.pythoninfo logs freedesktop_os_release() (#109057)
Victor Stinner [Thu, 7 Sep 2023 05:43:32 +0000 (07:43 +0200)] 
test.pythoninfo logs freedesktop_os_release() (#109057)

2 years agogh-108915: Removes extra backslashes in str.split docstring (#109044)
Daniel Weiss [Thu, 7 Sep 2023 05:33:51 +0000 (23:33 -0600)] 
gh-108915: Removes extra backslashes in str.split docstring (#109044)

2 years agogh-108753: _Py_PrintSpecializationStats() uses Py_hexdigits (#109040)
Victor Stinner [Thu, 7 Sep 2023 02:47:57 +0000 (04:47 +0200)] 
gh-108753: _Py_PrintSpecializationStats() uses Py_hexdigits (#109040)

2 years agogh-109045: Remove remaining LIMITED_API_AVAILABLE checks in tests (#109046)
Anders Kaseorg [Thu, 7 Sep 2023 02:42:58 +0000 (19:42 -0700)] 
gh-109045: Remove remaining LIMITED_API_AVAILABLE checks in tests (#109046)

Commit 13a00078b81776b23b0b6add69b848382240d1f2 (#108663) made all
Python builds compatible with the Limited API, and removed the
LIMITED_API_AVAILABLE flag.  However, some tests were still checking
for that flag, so they were now being incorrectly skipped.  Remove
these checks to let these tests run again.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2 years agogh-107265: Remove all ENTER_EXECUTOR when execute _Py_Instrument (gh-108539)
Dong-hee Na [Thu, 7 Sep 2023 00:53:54 +0000 (09:53 +0900)] 
gh-107265: Remove all ENTER_EXECUTOR when execute _Py_Instrument (gh-108539)

2 years agogh-107211: No longer export internal _PyLong_FromUid() (#109037)
Victor Stinner [Thu, 7 Sep 2023 00:09:06 +0000 (02:09 +0200)] 
gh-107211: No longer export internal _PyLong_FromUid() (#109037)

No longer export _PyLong_FromUid() and _Py_Sigset_Converter()
internal C API function.

2 years agogh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016)
Victor Stinner [Wed, 6 Sep 2023 23:58:03 +0000 (01:58 +0200)] 
gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016)

Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP
blackhole is enabled (net.inet.tcp.blackhole=2).

2 years agoDocs: Fix typo in datetime.tzinfo docstring (#107257)
Mikhail Samylov [Wed, 6 Sep 2023 21:29:46 +0000 (00:29 +0300)] 
Docs: Fix typo in datetime.tzinfo docstring (#107257)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoGH-108202: Document ``calendar``'s command-line interface (#109020)
Adam Turner [Wed, 6 Sep 2023 21:19:54 +0000 (22:19 +0100)] 
GH-108202: Document ``calendar``'s command-line interface (#109020)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoGH-104584: Restore frame->stacktop on optimizer error (GH-108953)
Brandt Bucher [Wed, 6 Sep 2023 20:59:50 +0000 (13:59 -0700)] 
GH-104584: Restore frame->stacktop on optimizer error (GH-108953)

2 years agogh-108751: Add copy.replace() function (GH-108752)
Serhiy Storchaka [Wed, 6 Sep 2023 20:55:42 +0000 (23:55 +0300)] 
gh-108751: Add copy.replace() function (GH-108752)

It creates a modified copy of an object by calling the object's
__replace__() method.

It is a generalization of dataclasses.replace(), named tuple's _replace()
method and replace() methods in various classes, and supports all these
stdlib classes.

2 years agogh-107732: Mention dir support in importlib.resources docs (#107734)
Shahriar Heidrich [Wed, 6 Sep 2023 20:53:32 +0000 (22:53 +0200)] 
gh-107732: Mention dir support in importlib.resources docs (#107734)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoGH-90690: Mention removal of ``PRECALL`` in What's New (#103910)
Anthony Shaw [Wed, 6 Sep 2023 20:28:00 +0000 (06:28 +1000)] 
GH-90690: Mention removal of ``PRECALL`` in What's New (#103910)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106307: Fix PyMapping_GetOptionalItemString() (GH-108797)
Serhiy Storchaka [Wed, 6 Sep 2023 19:47:38 +0000 (22:47 +0300)] 
gh-106307: Fix PyMapping_GetOptionalItemString() (GH-108797)

The resulting pointer was not set to NULL if the creation of a temporary
string object was failed.

The tests were also missed due to oversight.

2 years agoC API tests: use special markers to test that output parameters were set (GH-109014)
Serhiy Storchaka [Wed, 6 Sep 2023 19:02:01 +0000 (22:02 +0300)] 
C API tests: use special markers to test that output parameters were set (GH-109014)

2 years agogh-108740: Fix "make regen-all" race condition (#108741)
Victor Stinner [Wed, 6 Sep 2023 18:09:21 +0000 (20:09 +0200)] 
gh-108740: Fix "make regen-all" race condition (#108741)

Fix a race condition in "make regen-all". The deepfreeze.c source and
files generated by Argument Clinic are now generated or updated
before generating "global objects". Previously, some identifiers may
miss depending on the order in which these files were generated.

* "make regen-global-objects": Make sure that deepfreeze.c is
  generated and up to date, and always run "make clinic".
* "make clinic" no longer runs generate_global_objects.py script.
* "make regen-deepfreeze" now only updates deepfreeze.c (C file).
  It doesn't build deepfreeze.o (object) anymore.
* Remove misleading messages in "make regen-global-objects" and
  "make clinic". They are now outdated, these commands are now
  safe to use.
* Document generates files in Doc/using/configure.rst.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agogh-108753: Enhance pystats (#108754)
Victor Stinner [Wed, 6 Sep 2023 15:54:59 +0000 (17:54 +0200)] 
gh-108753: Enhance pystats (#108754)

Statistics gathering is now off by default. Use the "-X pystats"
command line option or set the new PYTHONSTATS environment variable
to 1 to turn statistics gathering on at Python startup.

Statistics are no longer dumped at exit if statistics gathering was
off or statistics have been cleared.

Changes:

* Add PYTHONSTATS environment variable.
* sys._stats_dump() now returns False if statistics are not dumped
  because they are all equal to zero.
* Add PyConfig._pystats member.
* Add tests on sys functions and on setting PyConfig._pystats to 1.
* Add Include/cpython/pystats.h and Include/internal/pycore_pystats.h
  header files.
* Rename '_py_stats' variable to '_Py_stats'.
* Exclude Include/cpython/pystats.h from the Py_LIMITED_API.
* Move pystats.h include from object.h to Python.h.
* Add _Py_StatsOn() and _Py_StatsOff() functions. Remove
  '_py_stats_struct' variable from the API: make it static in
  specialize.c.
* Document API in Include/pystats.h and Include/cpython/pystats.h.
* Complete pystats documentation in Doc/using/configure.rst.
* Don't write "all zeros" stats: if _stats_off() and _stats_clear()
  or _stats_dump() were called.
* _PyEval_Fini() now always call _Py_PrintSpecializationStats() which
  does nothing if stats are all zeros.

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2 years agogh-108851: Fix tomllib recursion tests (#108853)
Victor Stinner [Wed, 6 Sep 2023 15:34:31 +0000 (17:34 +0200)] 
gh-108851: Fix tomllib recursion tests (#108853)

* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().

2 years agogh-91960: Add FreeBSD build and test using Cirrus-CI (#91961)
Ed Maste [Wed, 6 Sep 2023 14:57:40 +0000 (10:57 -0400)] 
gh-91960: Add FreeBSD build and test using Cirrus-CI (#91961)

Cirrus-CI is a hosted CI service that supports FreeBSD, Linux, macOS,
and Windows.  Add a .cirrus.yml configuration file to provide CI coverage
on pull requests for FreeBSD 13.2.

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-109002: Ensure only one wheel for each vendored package (#109003)
Łukasz Langa [Wed, 6 Sep 2023 14:49:44 +0000 (16:49 +0200)] 
gh-109002: Ensure only one wheel for each vendored package (#109003)

Output with one wheel:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
Verifying checksum for /Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl.
Expected digest: 7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
Actual digest:   7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
::notice file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Successfully verified the checksum of the pip wheel.
```

Output with two wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-22.0.4-py3-none-any.whl::Found more than one wheel for package pip.

::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Found more than one wheel for package pip.
```

Output without wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=::Could not find a pip wheel on disk.
```

2 years agogh-91960: Skip test_gdb if gdb cannot retrive Python frames (#108999)
Victor Stinner [Wed, 6 Sep 2023 14:34:35 +0000 (16:34 +0200)] 
gh-91960: Skip test_gdb if gdb cannot retrive Python frames (#108999)

Skip test_gdb if gdb is unable to retrieve Python frame objects: if a
frame is "<optimized out>". When Python is built with "clang -Og",
gdb can fail to retrive the 'frame' parameter of
_PyEval_EvalFrameDefault(). In this case, tests like py_bt() are
likely to fail. Without getting access to Python frames,
python-gdb.py is mostly clueless on retrieving the Python traceback.
Moreover, test_gdb is no longer skipped on macOS if Python is built
with Clang.

2 years agogh-107219: Fix concurrent.futures terminate_broken() (#108974)
Victor Stinner [Wed, 6 Sep 2023 13:57:01 +0000 (15:57 +0200)] 
gh-107219: Fix concurrent.futures terminate_broken() (#108974)

Fix a race condition in _ExecutorManagerThread.terminate_broken():
ignore the InvalidStateError on future.set_exception(). It can happen
if the future is cancelled before the caller.

Moreover, test_crash_big_data() now waits explicitly until the
executor completes.

2 years agogh-108765: Cleanup #include in Python/*.c files (#108977)
Victor Stinner [Wed, 6 Sep 2023 13:56:08 +0000 (15:56 +0200)] 
gh-108765: Cleanup #include in Python/*.c files (#108977)

Mention one symbol imported by each #include.

2 years agogh-108303: Create Lib/test/test_dataclasses/ directory (#108978)
Victor Stinner [Wed, 6 Sep 2023 13:54:16 +0000 (15:54 +0200)] 
gh-108303: Create Lib/test/test_dataclasses/ directory (#108978)

Move test_dataclasses.py and its "dataclass_*.py" modules into the
new Lib/test/test_dataclasses/ subdirectory.

2 years agogh-108983: Add more PEP 526 tests to `test_grammar` (#108984)
Nikita Sobolev [Wed, 6 Sep 2023 13:41:38 +0000 (16:41 +0300)] 
gh-108983: Add more PEP 526 tests to `test_grammar` (#108984)

2 years agogh-108991: replace _PyFrame_GetState by two simpler functions (#108992)
Irit Katriel [Wed, 6 Sep 2023 11:54:59 +0000 (12:54 +0100)] 
gh-108991: replace _PyFrame_GetState by two simpler functions (#108992)

2 years agogh-106670: Fix Pdb handling of chained Exceptions with no stacks. (#108865)
Matthias Bussonnier [Wed, 6 Sep 2023 09:41:56 +0000 (11:41 +0200)] 
gh-106670: Fix Pdb handling of chained Exceptions with no stacks. (#108865)

2 years agoFix a typo in umarshal.py (#108803)
KH [Wed, 6 Sep 2023 09:06:41 +0000 (18:06 +0900)] 
Fix a typo in umarshal.py (#108803)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agogh-108717: Speedup `os.DirEntry.is_junction` function (#108718)
Nikita Sobolev [Wed, 6 Sep 2023 08:52:53 +0000 (11:52 +0300)] 
gh-108717: Speedup `os.DirEntry.is_junction` function (#108718)

2 years agogh-108857: improve markup in inspect.Signature.replace() docs (#108862)
nabin2004 [Wed, 6 Sep 2023 00:27:59 +0000 (06:12 +0545)] 
gh-108857: improve markup in inspect.Signature.replace() docs (#108862)

2 years agogh-108962: Skip test_tempfile.test_flags() if not supported (#108964)
Victor Stinner [Tue, 5 Sep 2023 21:59:40 +0000 (23:59 +0200)] 
gh-108962: Skip test_tempfile.test_flags() if not supported (#108964)

Skip test_tempfile.test_flags() if chflags() fails with "OSError:
[Errno 45] Operation not supported" (ex: on FreeBSD 13).

2 years agogh-106581: Support multiple uops pushing new values (#108895)
Guido van Rossum [Tue, 5 Sep 2023 20:58:39 +0000 (13:58 -0700)] 
gh-106581: Support multiple uops pushing new values (#108895)

Also avoid the need for the awkward .clone() call in the argument
to mgr.adjust_inverse() and mgr.adjust().

2 years agogh-108469: Update ast.unparse for unescaped quote support from PEP701 [3.12] (#108553)
Anthony Shaw [Tue, 5 Sep 2023 20:01:23 +0000 (06:01 +1000)] 
gh-108469: Update ast.unparse for unescaped quote support from PEP701 [3.12] (#108553)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2 years agogh-107755: Document the correct default value of slice step (GH-107756)
wim glenn [Tue, 5 Sep 2023 19:22:27 +0000 (14:22 -0500)] 
gh-107755: Document the correct default value of slice step (GH-107756)

Document the correct default value of slice step.

2 years agogh-108927: Fix test_import + test_importlib + test_unittest problem (#108929)
Nikita Sobolev [Tue, 5 Sep 2023 18:57:48 +0000 (21:57 +0300)] 
gh-108927: Fix test_import + test_importlib + test_unittest problem (#108929)

2 years agogh-107565: Update Windows build to use OpenSSL 3.0.10 (GH-108928)
Zachary Ware [Tue, 5 Sep 2023 16:03:06 +0000 (11:03 -0500)] 
gh-107565: Update Windows build to use OpenSSL 3.0.10 (GH-108928)

Also clean up some intermediate NEWS entries about previous versions.

2 years agogh-108903: Remove unneeded `lambda`s from `asyncio` (GH-108904)
Nikita Sobolev [Tue, 5 Sep 2023 15:11:12 +0000 (18:11 +0300)] 
gh-108903: Remove unneeded `lambda`s from `asyncio` (GH-108904)

2 years agogh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime...
Serhiy Storchaka [Tue, 5 Sep 2023 14:56:30 +0000 (17:56 +0300)] 
gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480)

2 years agogh-89392: Use unittest test runner for doctests in test_getopt (GH-108916)
Serhiy Storchaka [Tue, 5 Sep 2023 14:35:28 +0000 (17:35 +0300)] 
gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916)

2 years agogh-89392: Use normal unittest runner in test_type_cache (GH-108911)
Serhiy Storchaka [Tue, 5 Sep 2023 13:46:17 +0000 (16:46 +0300)] 
gh-89392: Use normal unittest runner in test_type_cache (GH-108911)

2 years agoAdd missed "f" in an f-string (GH-108906)
Serhiy Storchaka [Tue, 5 Sep 2023 12:00:28 +0000 (15:00 +0300)] 
Add missed "f" in an f-string (GH-108906)

2 years agoGH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772)
Mark Shannon [Tue, 5 Sep 2023 11:35:52 +0000 (12:35 +0100)] 
GH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772)

2 years agogh-108840: Remove unused `TestEnumTypeSubclassing` from `test_enum` (#108841)
Nikita Sobolev [Tue, 5 Sep 2023 08:45:54 +0000 (11:45 +0300)] 
gh-108840: Remove unused `TestEnumTypeSubclassing` from `test_enum` (#108841)

2 years agogh-108294: Add error handling for time.sleep audit event (GH-108363)
Petr Viktorin [Tue, 5 Sep 2023 08:25:08 +0000 (10:25 +0200)] 
gh-108294: Add error handling for time.sleep audit event (GH-108363)

I've also cleaned the tests up a bit to make this easier to test.

2 years agoImprove the GitHub issue forms (#108881)
Alex Waygood [Tue, 5 Sep 2023 08:01:30 +0000 (09:01 +0100)] 
Improve the GitHub issue forms (#108881)

2 years agoGH-108390: Prevent non-local events being set with `sys.monitoring.set_local_events...
Mark Shannon [Tue, 5 Sep 2023 07:03:53 +0000 (08:03 +0100)] 
GH-108390: Prevent non-local events being set with `sys.monitoring.set_local_events()` (GH-108420)

2 years agogh-89392: Remove support of test_main() in libregrtest (GH-108876)
Serhiy Storchaka [Tue, 5 Sep 2023 05:36:43 +0000 (08:36 +0300)] 
gh-89392: Remove support of test_main() in libregrtest (GH-108876)

2 years agogh-108834: regrtest --fail-rerun exits with code 5 (#108896)
Victor Stinner [Tue, 5 Sep 2023 01:09:42 +0000 (03:09 +0200)] 
gh-108834: regrtest --fail-rerun exits with code 5 (#108896)

When the --fail-rerun option is used and a test fails and then pass,
regrtest now uses exit code 5 ("rerun) instead of 2 ("bad test").

2 years agogh-106320: Remove private _PyErr_WriteUnraisableMsg() (#108863)
Victor Stinner [Mon, 4 Sep 2023 23:54:55 +0000 (01:54 +0200)] 
gh-106320: Remove private _PyErr_WriteUnraisableMsg() (#108863)

Move the private _PyErr_WriteUnraisableMsg() functions to the
internal C API (pycore_pyerrors.h).

Move write_unraisable_exc() from _testcapi to _testinternalcapi.

2 years agogh-108463: Make expressions/statements work as expected in pdb (#108464)
Tian Gao [Mon, 4 Sep 2023 21:44:40 +0000 (14:44 -0700)] 
gh-108463: Make expressions/statements work as expected in pdb (#108464)

2 years agoLink to PEP sections in What's New in 3.12 (#108878)
Hugo van Kemenade [Mon, 4 Sep 2023 21:02:25 +0000 (15:02 -0600)] 
Link to PEP sections in What's New in 3.12 (#108878)

2 years agoCI: Bump GitHub Actions (#108879)
Hugo van Kemenade [Mon, 4 Sep 2023 20:36:16 +0000 (14:36 -0600)] 
CI: Bump GitHub Actions (#108879)

2 years agoDisable `differing_test_runners` health check (#108886)
Nikita Sobolev [Mon, 4 Sep 2023 18:31:58 +0000 (21:31 +0300)] 
Disable `differing_test_runners` health check (#108886)

2 years agogh-107902: Don't test setting suid/sgid on systems that don't support them (GH-108368)
Petr Viktorin [Mon, 4 Sep 2023 13:46:00 +0000 (15:46 +0200)] 
gh-107902: Don't test setting suid/sgid on systems that don't support them (GH-108368)

2 years agogh-89392: Fix running test_pep646_syntax as script (GH-108875)
Serhiy Storchaka [Mon, 4 Sep 2023 12:24:03 +0000 (15:24 +0300)] 
gh-89392: Fix running test_pep646_syntax as script (GH-108875)

2 years agoGH-108614: Remove `TIER_ONE` and `TIER_TWO` from `_PUSH_FRAME` (GH-108725)
Mark Shannon [Mon, 4 Sep 2023 10:36:57 +0000 (11:36 +0100)] 
GH-108614: Remove `TIER_ONE` and `TIER_TWO` from `_PUSH_FRAME` (GH-108725)

2 years agobpo-45229: Make ElementTree tests discoverable (GH-108859)
Serhiy Storchaka [Mon, 4 Sep 2023 10:04:32 +0000 (13:04 +0300)] 
bpo-45229: Make ElementTree tests discoverable (GH-108859)

2 years agogh-89392: Make test_pep646_syntax discoverable (GH-108861)
Serhiy Storchaka [Mon, 4 Sep 2023 09:41:58 +0000 (12:41 +0300)] 
gh-89392: Make test_pep646_syntax discoverable (GH-108861)

2 years agogh-89392: Remove test_main() in test_netrc (GH-108860)
Serhiy Storchaka [Mon, 4 Sep 2023 09:41:13 +0000 (12:41 +0300)] 
gh-89392: Remove test_main() in test_netrc (GH-108860)

2 years agoRevert "gh-46376: Return existing pointer when possible in ctypes (#1… (#108688)
Victor Stinner [Mon, 4 Sep 2023 09:21:47 +0000 (11:21 +0200)] 
Revert "gh-46376: Return existing pointer when possible in ctypes (#1… (#108688)

This reverts commit 08447b5deb47e2a0df87fa0a0576d300e5c909b4.

Revert also _ctypes.c changes of the PyDict_ContainsString() change,
commit 67266266469fe0e817736227f39537182534c1a5.

2 years agogh-108765: Move export code from pyport.h to exports.h (#108855)
Victor Stinner [Sun, 3 Sep 2023 23:04:05 +0000 (01:04 +0200)] 
gh-108765: Move export code from pyport.h to exports.h (#108855)

There is no API change, since pyport.h includes exports.h.

2 years agogh-108834: regrtest reruns failed tests in subprocesses (#108839)
Victor Stinner [Sun, 3 Sep 2023 21:37:15 +0000 (23:37 +0200)] 
gh-108834: regrtest reruns failed tests in subprocesses (#108839)

When using --rerun option, regrtest now re-runs failed tests
in verbose mode in fresh worker processes to have more
deterministic behavior. So it can write its final report even
if a test killed a worker progress.

Add --fail-rerun option to regrtest: exit with non-zero exit code
if a test failed pass passed when re-run in verbose mode (in a
fresh process). That's now more useful since tests can pass
when re-run in a fresh worker progress, whereas they failed
when run after other tests when tests are run sequentially.

Rename --verbose2 option (-w) to --rerun. Keep --verbose2 as a
deprecated alias.

Changes:

* Fix and enhance statistics in regrtest summary. Add "(filtered)"
  when --match and/or --ignore options are used.
* Add RunTests class.
* Add TestResult.get_rerun_match_tests() method
* Rewrite code to serialize/deserialize worker arguments as JSON
  using a new WorkerJob class.
* Fix stats when a test is run with --forever --rerun.
* If failed test names cannot be parsed, log a warning and don't
  filter tests.
* test_regrtest.test_rerun_success() now uses a marker file, since
  the test is re-run in a separated process.
* Add tests on normalize_test_name() function.
* Add test_success() and test_skip() tests to test_regrtest.

2 years agogh-108765: Move stat() fiddling from pyport.h to fileutils.h (#108854)
Victor Stinner [Sun, 3 Sep 2023 21:32:13 +0000 (23:32 +0200)] 
gh-108765: Move stat() fiddling from pyport.h to fileutils.h (#108854)

2 years agoUpdate Lib/test/test_unittest/testmock/testmock.py: fix typo RuntimError to RuntimeEr...
Sangyun_LEE [Sun, 3 Sep 2023 21:19:49 +0000 (06:19 +0900)] 
Update Lib/test/test_unittest/testmock/testmock.py: fix typo RuntimError to RuntimeError (#108847)

2 years agogh-108765: Python.h no longer includes <ctype.h> (#108831)
Victor Stinner [Sun, 3 Sep 2023 16:54:27 +0000 (18:54 +0200)] 
gh-108765: Python.h no longer includes <ctype.h> (#108831)

Remove <ctype.h> in C files which don't use it; only sre.c and
_decimal.c still use it.

Remove _PY_PORT_CTYPE_UTF8_ISSUE code from pyport.h:

* Code added by commit b5047fd01948ab108edcc1b3c2c901d915814cfd
  in 2004 for MacOSX and FreeBSD.
* Test removed by commit 52ddaefb6bab1a74ecffe8519c02735794ebfbe1
  in 2007, since Python str type now uses locale independent
  functions like Py_ISALPHA() and Py_TOLOWER() and the Unicode
  database.

Modules/_sre/sre.c replaces _PY_PORT_CTYPE_UTF8_ISSUE with new
functions: sre_isalnum(), sre_tolower(), sre_toupper().

Remove unused includes:

* _localemodule.c: remove <stdio.h>.
* getargs.c: remove <float.h>.
* dynload_win.c: remove <direct.h>, it no longer calls _getcwd()
  since commit fb1f68ed7cc1536482d1debd70a53c5442135fe2 (in 2001).

2 years agogh-108494: Argument Clinic: inline parsing code for positional-only parameters in...
Serhiy Storchaka [Sun, 3 Sep 2023 14:28:14 +0000 (17:28 +0300)] 
gh-108494: Argument Clinic: inline parsing code for positional-only parameters in the limited C API (GH-108622)

2 years agoFix duplicated words 'Be be' (GH-108815)
Виталий Дмитриев [Sun, 3 Sep 2023 13:35:13 +0000 (16:35 +0300)] 
Fix duplicated words 'Be be' (GH-108815)

2 years agoReorder some test's decorators (GH-108804)
Serhiy Storchaka [Sun, 3 Sep 2023 12:21:43 +0000 (15:21 +0300)] 
Reorder some test's decorators (GH-108804)

For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.

2 years agogh-102837: improve test coverage for math module (#102523)
Sergey B Kirpichev [Sun, 3 Sep 2023 08:48:47 +0000 (11:48 +0300)] 
gh-102837: improve test coverage for math module (#102523)

- input checks for math_1(L989), math_1a(L1023), math_2(L1064,L1071), hypot(L2682), log(L2307), ldexp(L2168), ceil(L1165), floor(L1236,L1239) and dist(L2587,L2588,L2628).
- drop inaccessible "if" branch (L3518) in perm_comb_small()
- improve fsum coverage for exceptional cases (L1433,L1438,L1451,L1497), ditto fmod(L2378)
- rewrite modf to fix inaccessible case(L2229), ditto for pow(L2988)

(all line numbers are wrt the main branch at 5e6661bce9)

2 years agogh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)
Raymond Hettinger [Sun, 3 Sep 2023 03:25:13 +0000 (22:25 -0500)] 
gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)

gh-107208: iter_index now supports "stop" and no longer swallows ValueError

2 years agogh-108765: pystrhex: Replace stdlib.h abs() with Py_ABS() (#108830)
Victor Stinner [Sat, 2 Sep 2023 21:15:54 +0000 (23:15 +0200)] 
gh-108765: pystrhex: Replace stdlib.h abs() with Py_ABS() (#108830)

2 years agogh-108374: Add --disable-gil option to PCbuild/build.bat (#108729)
Sam Gross [Sat, 2 Sep 2023 21:13:00 +0000 (21:13 +0000)] 
gh-108374: Add --disable-gil option to PCbuild/build.bat (#108729)

This adds a `--disable-gil` option to PCbuild/build.bat. For now, all
this does is define the Py_NOGIL macro.

2 years agogh-108765: include <unistd.h> in termios.c on Solaris (#108825)
Jakub Kulík [Sat, 2 Sep 2023 18:57:47 +0000 (20:57 +0200)] 
gh-108765: include <unistd.h> in termios.c on Solaris (#108825)

2 years agogh-63760: Don't declare gethostname() on Solaris (#108817)
Victor Stinner [Sat, 2 Sep 2023 17:54:59 +0000 (19:54 +0200)] 
gh-63760: Don't declare gethostname() on Solaris (#108817)

Since 2005, Solaris defines gethostname(). socketmodule.c no longer
has to define gethostname() for Solaris.

Oracle Solaris and OpenSolaris have patches to remove the
gethostname() definition in Python:

* https://github.com/oracle/solaris-userland/blob/master/components/python/python37/patches/15-gethostname.patch
* https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/python/python37/patches/15-gethostname.patch
* https://github.com/omniosorg/omnios-build/blob/master/build/python27/patches/24-gethostname.patch

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>