Commit graph

119514 commits

Author SHA1 Message Date
Serhiy Storchaka e3353c498d
gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533) 2023-10-31 08:48:52 +02:00
Karolina Surma 3dbaed3caa
gh-111301: Move importlib.resources changes to the Removed section (#111509) 2023-10-31 06:46:20 +00:00
Karolina Surma 9976834356
gh-111301: Move importlib.resources.files change to What's new in Python 3.12 (#111512) 2023-10-31 06:01:00 +00:00
Hugo van Kemenade 173d13bb1f
gh-111062 CI: Update skip lists for resuable workflows (#111521)
CI: Update skip lists
2023-10-31 07:49:15 +02:00
Michael Droettboom 9495bcaf59
gh-111277: In summarize_stats.py, don't fail fast on invalid ratios (#111278) 2023-10-30 17:10:07 -07:00
Michael Droettboom 84b4533e84
gh-109329: Count tier2 opcode misses (#110561)
This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
2023-10-30 17:02:45 -07:00
Eric Snow c6fe0869ab
gh-76785: Move the Cross-Interpreter Code to Its Own File (gh-111502)
This is partly to clear this stuff out of pystate.c, but also in preparation for moving some code out of _xxsubinterpretersmodule.c.  This change also moves this stuff to the internal API (new: Include/internal/pycore_crossinterp.h).  @vstinner did this previously and I undid it.  Now I'm re-doing it. :/
2023-10-30 16:53:10 -06:00
Victor Stinner 7b153d14ef
gh-110697: Use CLOCK_RES in test_os.TimerfdTests (#111529)
More TimerfdTests tests tolerate a difference of 1 ms in measured
elapsed time.
2023-10-30 22:47:59 +00:00
Victor Stinner 801741ff81
gh-90815: Fix mimalloc atomic.h on Windows arm64 (#111527)
mi_atomic_load_explicit() casts 'p' argument to drop the 'const'
qualifier on Windows arm64 platform. Fix the compiler warning:

    'function': different 'const' qualifiers
    (compiling source file ..\Objects\mimalloc\options.c)
2023-10-30 22:33:49 +00:00
Victor Stinner 1673e44017
gh-90815: Fix mimalloc build on WASI (#111524)
Include <unistd.h> to get sbrk() function.
2023-10-30 23:10:22 +01:00
Victor Stinner da4d3142a2
gh-90815: Fix _PyMem_MimallocEnabled() compiler warning (#111522)
Don't declare _PyMem_MimallocEnabled() if WITH_PYMALLOC macro is not
defined (./configure --without-pymalloc).

Fix also a typo in _PyInterpreterState_FinalizeAllocatedBlocks().
2023-10-30 23:05:49 +01:00
Ken Jin 804a207c16
Remove myself from typing CODEOWNERS (#111523) 2023-10-30 21:08:26 +00:00
Nikita Sobolev c4dc5a6ae8
gh-111181: Fix enum doctests (GH-111180)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-10-30 12:56:29 -07:00
Pablo Galindo Salgado cd6e0a04a1
gh-111366: Correctly show custom syntax error messages in the codeop module functions (#111384) 2023-10-30 19:24:21 +00:00
Serhiy Storchaka 624ace5a2f
gh-111284: Make multiprocessing tests with threads faster and more reliable (GH-111285) 2023-10-30 19:18:36 +02:00
Donghee Na 55df2deb1a
gh-110481: Fix _Py_ThreadId for non-free-threaded mode (gh-111503) 2023-10-31 02:16:18 +09:00
Serhiy Storchaka bca3305429
gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455)
Also document the behavior when called with NULL.
2023-10-30 19:01:03 +02:00
Riccardo Ghetta 8eaa206fec
gh-109515: When generating deep frozen modules on Windows, use a list file instead of arguments (GH-109516) 2023-10-30 16:14:26 +00:00
Sam Gross 6dfb8fe023
gh-110481: Implement biased reference counting (gh-110764) 2023-10-30 16:06:09 +00:00
Dino Viehland 05f2f0ac92
gh-90815: Add mimalloc memory allocator (#109914)
* Add mimalloc v2.12

Modified src/alloc.c to remove include of alloc-override.c and not
compile new handler.

Did not include the following files:

 - include/mimalloc-new-delete.h
 - include/mimalloc-override.h
 - src/alloc-override-osx.c
 - src/alloc-override.c
 - src/static.c
 - src/region.c

mimalloc is thread safe and shares a single heap across all runtimes,
therefore finalization and getting global allocated blocks across all
runtimes is different.

* mimalloc: minimal changes for use in Python:

 - remove debug spam for freeing large allocations
 - use same bytes (0xDD) for freed allocations in CPython and mimalloc
   This is important for the test_capi debug memory tests

* Don't export mimalloc symbol in libpython.
* Enable mimalloc as Python allocator option.
* Add mimalloc MIT license.
* Log mimalloc in Lib/test/pythoninfo.py.
* Document new mimalloc support.
* Use macro defs for exports as done in:
  https://github.com/python/cpython/pull/31164/

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-30 15:43:11 +00:00
Donghee Na 4ebf2fae96
gh-111062: Reusable Windows build that supports free-threaded mode as the conditional CI (#111493)
* gh-111062 Set up free-threaded CI for windows

Co-authored-by: Donghee Na <donghee.na@python.org>

* Apply suggestions from code review

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Update

* Update names

* Add files

* Update

* Revert "Update"

This reverts commit 4f17e1af0d.

* fix

---------

Co-authored-by: juanjose.tenorio <juanjose2611@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-31 00:30:40 +09:00
Donghee Na c6def360d1
gh-111062: Update name of reusable workflows for Ubuntu / macOS (gh-111494)
gh-111062 Update name of reusable workflows for linux / macOS
2023-10-30 15:15:22 +00:00
NCLI c19561b9ca
gh-111062: Reusable ubuntu build that supports free-threaded mode as the conditional CI (#111452)
Co-authored-by: Donghee Na <donghee.na92@gmail.com>
2023-10-30 16:28:16 +02:00
scoder 940ee962a8
gh-106168: Check allocated instead of size index bounds in PyList_SET_ITEM() (#111480)
Check the index bound assertions in PyList_SET_ITEM() against [0:allocated] instead of [0:size] to re-allow valid use cases that assign within the allocated area.
2023-10-30 12:24:21 +01:00
Savannah Ostrowski 4a929d432b
GH-111339: Fix initialization and finalization of static optimizer types (GH-111430) 2023-10-29 13:53:25 -07:00
Serhiy Storchaka 4d6bdf8aab
gh-111165: Remove documentation for moved functions (GH-111467) 2023-10-29 21:34:22 +02:00
Nikita Sobolev 46389c3275
gh-101100: Fix sphinx warnings in library/asyncio-eventloop.rst (GH-111222)
* gh-101100: Fix sphinx warnings in `library/asyncio-eventloop.rst`

* Update Doc/library/socket.rst

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Update asyncio-eventloop.rst

* Update socket.rst

---------

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-29 12:31:01 -07:00
zcxsythenew fa35b9e89b
gh-111347: Remove wrong assertion in test_sendfile (#111377)
Windows is different.
2023-10-29 08:22:15 -07:00
Dima Tisnek 14ab5e51c1
gh-111062: Build both default and free-threaded on macOS (gh-111449) 2023-10-29 07:20:11 +00:00
Evan Kohilas 842e5fcdcd
gh-94808: Add coverage test for number check (gh-111445) 2023-10-29 07:00:19 +00:00
Dima Tisnek 3ac9851d69
gh-111062: Separate macOS build into a reusable workflow (gh-111444) 2023-10-29 06:12:16 +00:00
c-bata 8c47ada2de
gh-66425: Remove the unreachable code to set REMOTE_HOST header (gh-111441) 2023-10-29 13:56:15 +09:00
Nikita Sobolev 66bea2555d
gh-111426: Remove test_cmd.test_coverage (#111427) 2023-10-29 00:01:53 +01:00
Barney Gale 81bc802a46
GH-110109: Move tests for pathlib.Path.walk() into main test classes. (#110655) 2023-10-28 22:26:36 +01:00
Guido van Rossum 2655369559
gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336)
* Try to fix asyncio.Server.wait_closed() again

I identified the condition that `wait_closed()` is intended
to wait for: the server is closed *and* there are no more
active connections.

When this condition first becomes true, `_wakeup()` is called
(either from `close()` or from `_detach()`) and it sets `_waiters`
to `None`. So we just check for `self._waiters is None`; if it's
not `None`, we know we have to wait, and do so.

A problem was that the new test introduced in 3.12 explicitly
tested that `wait_closed()` returns immediately when the server
is *not* closed but there are currently no active connections.
This was a mistake (probably a misunderstanding of the intended
semantics). I've fixed the test, and added a separate test that
checks exactly for this scenario.

I also fixed an oddity where in `_wakeup()` the result of the
waiter was set to the waiter itself. This result is not used
anywhere and I changed this to `None`, to avoid a GC cycle.

* Update Lib/asyncio/base_events.py

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-10-28 18:04:29 +00:00
Hugo van Kemenade 9d4a1a480b
CI: Include Python version in cache.config key (#111410)
* Include Python version in cache.config key, after Python setup

* Remove EOL 3.7 from branch triggers
2023-10-28 10:23:47 +03:00
Sergey B Kirpichev 9dc4fb8204
gh-111342: fix typo in math.sumprod (GH-111416) 2023-10-27 23:52:04 -05:00
Guido van Rossum c3bb10c930
gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() (#110884)
- `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything.
- Threads created by that class are now named `asyncio-waitpid-NNN`.
- `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
2023-10-27 15:44:12 -07:00
Tian Gao 1c9a0c4079
gh-59013: Make line number of function breakpoint more precise (#110582) 2023-10-27 22:01:31 +01:00
Victor Stinner 77bb0d5f50
gh-108765: Include explicitly <unistd.h> in signalmodule.c (#111402)
unistd.h is needed by alarm() and pause() functions.
2023-10-27 20:56:12 +00:00
Zack Cerza 8a158a753c
gh-111406: Fix broken link to bpython's site (#111407) 2023-10-27 18:36:22 +00:00
Jonathan Berthias 9a2f2f46ca
Fix typos in import system docs (#111396) 2023-10-27 13:20:55 +00:00
Nikita Sobolev 524a701d07
gh-111386: Fix uint32_t cast in generated_cases.c.h (#111387) 2023-10-27 12:37:59 +01:00
Nikita Sobolev aa732459c5
gh-111388: Add show_group parameter to traceback.format_exception_only (#111390) 2023-10-27 11:11:26 +01:00
Łukasz Langa 6d42759c5e
gh-111276: Clarify docs and comments about the role of LC_CTYPE (#111319)
Fix locale.LC_CTYPE documentation to no longer mention string.lower() et al. Those functions were removed in Python 3.0:
https://docs.python.org/2/library/string.html#deprecated-string-functions

Also, fix a comment in logging about locale-specific behavior of `str.lower()`.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-27 11:43:01 +02:00
Satish Pokala 74f0772892
no-issue: Remove unused variable in getpath.py (gh-111372) 2023-10-27 15:25:22 +09:00
Raymond Hettinger 7f9a99e854
gh-89519: Remove classmethod descriptor chaining, deprecated since 3.11 (gh-110163) 2023-10-27 00:24:56 -05:00
Nikita Sobolev ee2d22f06d
gh-111343: Fix itertools docs: start arg is optional for count (gh-111344) 2023-10-27 04:30:13 +00:00
gsallam 21f068d80c
gh-109587: Allow "precompiled" perf-trampolines to largely mitigate the cost of enabling perf-trampolines (#109666) 2023-10-27 03:57:29 +00:00
Pablo Galindo Salgado 3d2f1f0b83
gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (#111381) 2023-10-27 12:19:34 +09:00