Commit Graph

119395 Commits

Author SHA1 Message Date
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
Tian Gao a254120f2f
GH-94438: Fix RuntimeWarning for jump tests in test_sys_settrace (GH-111341) 2023-10-26 11:47:51 -07:00
zcxsythenew b468538d35
GH-111293: Fix DirEntry.inode dropping higher bits on Windows (GH-111294) 2023-10-26 17:37:52 +01:00
Irit Katriel a0c414c35d
gh-111354: define names for RESUME oparg values (#111365) 2023-10-26 16:30:18 +01:00
Serhiy Storchaka 309efb39dc
gh-111259: Optimize recursive wildcards in pathlib (GH-111303)
Regular expression pattern `(?s:.)` is much faster than `[\s\S]`.
2023-10-26 18:07:06 +03:00
Irit Katriel 67a91f78e4
gh-109094: replace frame->prev_instr by frame->instr_ptr (#109095) 2023-10-26 13:43:10 +00:00
Serhiy Storchaka 573eff3e2e
Output more details in the re tracing (GH-111357) 2023-10-26 16:42:42 +03:00
Nikita Sobolev 31c05b72c1
gh-111348: Fix direct invocation of `test_doctest`; remove `test_doctest.test_coverage` (#111349)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-10-26 12:45:39 +00:00
Mark Shannon b0699aa544
GH-111213: Fix a few broken stats (GH-111216) 2023-10-26 11:33:12 +01:00
Mark Shannon 5c9d4497ab
GH-111339: Change `valid` property of executors to `is_valid()` method (GH-111350) 2023-10-26 11:31:51 +01:00
Batuhan Taskaya 78e6d72e38
bpo-43950: handle wide unicode characters in tracebacks (#28150) 2023-10-26 07:05:29 +00:00
Pablo Galindo Salgado 90a1b2859f
gh-67224: Show source lines in tracebacks when using the -c option when running Python (#111200) 2023-10-26 15:17:28 +09:00
Tian Gao 3f84a19e62
Docs: Add `restart_events()` and positional arg semantics for `sys.monitoring` (#111291)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-10-25 18:03:32 +00:00
Khalil Mouawad 14f52e1548
gh-110679: Improved markup in enum.rst (GH-110747) 2023-10-25 10:32:09 -07:00
Irit Katriel 0db2517687
gh-100762: Fix optimization in gen_close (#111069) 2023-10-25 16:22:34 +01:00
Serhiy Storchaka a4981921aa
gh-111165: Add missed "support." prefix for "verbose" (GH-111327) 2023-10-25 14:50:25 +00:00
Erlend E. Aasland 1262e41842
gh-108590: Improve sqlite3 docs on encoding issues and how to handle those (#108699)
Add a guide for how to handle non-UTF-8 text encodings.
Link to that guide from the 'text_factory' docs.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Corvin <corvin@corvin.dev>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 15:58:00 +02:00
Hugo van Kemenade 81ed80d843
gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (#111188) 2023-10-25 16:47:41 +03:00
Nikita Sobolev f6304949bb
gh-111230: Fix errors checking in _ssl module init (#111232)
Introduce ADD_INT_CONST macro wrapper for PyModule_AddIntConstant()
2023-10-25 15:42:18 +02:00
Serhiy Storchaka 9da98c0d9a
gh-111174: Fix crash in getbuffer() called repeatedly for empty BytesIO (GH-111210) 2023-10-25 13:50:16 +03:00