Skip to content

merging into my modded python. thank you for helping me - #1

Open
sidlovescoding wants to merge 232 commits into
sidlovescoding:mainfrom
python:main
Open

sidlovescoding wants to merge 232 commits into
sidlovescoding:mainfrom
python:main

Conversation

@sidlovescoding

Copy link
Copy Markdown
Owner

No description provided.

NekoAsakura and others added 30 commits November 6, 2026 12:04
Co-authored-by: sobolevn <mail@sobolevn.me>
* Add a freelist for traceback objects

A traceback object is created for every raised exception. Keep up to 8
of them on a per-thread freelist, and replace the argument check in
tb_create_raw() with asserts since all callers validate their arguments.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Apply suggestion from @eendebakpt

* Apply suggestion from @eendebakpt

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…60620)

Co-authored-by: Maciej Olko <maciej.olko@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…()` (#160737)

Co-authored-by: Stan Ulbrych <stan@python.org>
Fix handle leaks in test_tcl when the test is run with -R 3:3. Call
explicitly Tcl_FinalizeThread() in test_returning_deeply_nested() to
clean up explicitly per-thread state. The test is run in a thread
because of the @run_with_limited_c_stack() decorator.

On Windows, Tcl_CreateInterp() creates an event in the Tcl notifier
implementation. The event is stored in per-thread state which is only
cleaned up at exit.

Add the private _tkinter._finalize_thread() function.
Pickles name posixmodule types and functions either through os or
through the platform module (posix or nt).  Both spellings must keep
loading.

times_result, uname_result, waitid_result, sched_param, DirEntry and
ScandirIterator were named after the platform module (posix or nt), so
pickles referenced posix.times_result and could not be loaded on
Windows.  Name them os.<type> like stat_result (gh-63408).  Older
pickles keep loading through the platform module.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
…161481)

Result is mangled repr(). Extremely unlikely to be seen by IDLE users, but idlelib maintainers might if internal error.
…161460)

* gh-161458: Move test_file_eintr into test_io
* gh-161458: Move test_winconsoleio into test_io
* gh-161458: Move test_free_threading/test_io into test_io as test_free_threading
* gh-161458: Skip test_io.test_free_threading on GIL builds

   The test_free_threading package skipped these on GIL builds.
* gh-161458: Remove the test module list from the test_io docstring

   It goes stale whenever a module is added or moved.
* gh-161458: Point to I/O tests outside test_io in its docstring

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fix test_gdb when Python is built out-of-tree and Python is run from
a virtual environment. Previously, test_gdb was just skipped.

Fix CHECKOUT_HOOK_PATH in test_gdb.util: get python-gdb.py from the
build directory, rather than using the sys.executable directory.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
The TYPES topic listed FILES, which was removed from Helper.topics in
Python 3.4, and the UNICODE topic listed unicode, the Python 2 built-in
type. help() finds no entry for either of them.
* docs: Fix typos in API references and examples
* docs: Revert turtle example change
* docs: Fix unresolved ensure_value references in optparse
* docs: Match tracemalloc example traceback order to its output
* Apply batched suggestions from code review

---------

Co-authored-by: Stan Ulbrych <stan@python.org>
…SPARC (#161476)

On Linux, GCC and clang pass arrays of floating-point type in a structure
in integer registers; only Solaris follows the vendor ABI there (GCC PR
target/114416). Since gh-110190, ctypes described such array elements to
libffi as floats on all SPARC, so libffi read structures returned by value
from the FP registers on Linux.
No longer list tests expected to be skipped in the final report.

Strip also "test." prefix in TestResults to make the output shorter.
…tp.cookiejar` (#161570)

gh-161569: Check cookie policy before deleting expired cookies in http.cookiejar

An expired Set-Cookie header was allowed to delete a stored cookie using
the Domain and Path attributes taken verbatim from the header, before
CookiePolicy.set_ok() was consulted. A response from one host could
therefore delete cookies belonging to any other domain in a shared jar.

The policy is now consulted before an expired cookie may delete an
existing one, as required by RFC 6265 section 5.3.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <stan@python.org>
Filter test_io.test_free_threading (need Free Threading),
test_io.test_winconsoleio (need Windows),
and test_io.test_file_eintr (need subprocess).
`_PyHamt_Assoc` allocates HAMT nodes, which can trigger GC. A weakref callback or finaliser fired during GC could re-enter `contextvar_set`, replacing `ctx->ctx_vars` via `Py_SETREF` and freeing the old HAMT while `_PyHamt_Assoc` was still traversing it, causing a use-after-free.

Hold a strong reference to `ctx->ctx_vars` during the `_PyHamt_Assoc` call, so that a re-entrant free cannot affect the HAMT being traversed.
maurycy and others added 30 commits November 18, 2026 21:44
Call the internal reader's `readline()` in `_io` and `_pyio`. 

There is behaviour change. `BufferedRWPair.readline()` would behave like `BufferedReader.readline()`: in C, a non-blocking read with no data returns the partial line or `b''` instead of raising  `OSError`, a closed pair always raises `ValueError`, and subclass overrides of `peek()` and `read()` would no longer apply.
…tors (#162241)

Remove the integer-location branches from the sampling collectors. Live samples and binary replay use four-field locations or None.
gh-161751: Fix race in mimalloc abandoned segment visit in free-threaded GC
Doc: Correct examples and API descriptions in the logging HOWTO and cookbook
Rename HAVE_CURSES_xxx macros, added to Python 3.16, to
_Py_HAVE_CURSES_xxx.

Rename macros of functions:

* define_key(): HAVE_CURSES_DEFINE_KEY
* has_mouse(): HAVE_CURSES_HAS_MOUSE
* is_keypad(): HAVE_CURSES_IS_KEYPAD
* is_leaveok(): HAVE_CURSES_IS_LEAVEOK
* key_defined(): HAVE_CURSES_KEY_DEFINED
* keyok(): HAVE_CURSES_KEYOK
* new_prescr(): HAVE_CURSES_NEW_PRESCR
* nofilter(): HAVE_CURSES_NOFILTER
* scr_dump(): HAVE_CURSES_SCR_DUMP
* scr_set(): HAVE_CURSES_SCR_SET
* slk_attr_off(): HAVE_CURSES_SLK_ATTR_OFF
* slk_attr_on(): HAVE_CURSES_SLK_ATTR_ON
* slk_attr_set(): HAVE_CURSES_SLK_ATTR_SET
* slk_color(): HAVE_CURSES_SLK_COLOR
* term_attrs(): HAVE_CURSES_TERM_ATTRS
* use_screen(): HAVE_CURSES_USE_SCREEN
* use_window(): HAVE_CURSES_USE_WINDOW
* wattr_get(): HAVE_CURSES_WATTR_GET
* wattr_off(): HAVE_CURSES_WATTR_OFF
* wattr_on(): HAVE_CURSES_WATTR_ON
* wattr_set(): HAVE_CURSES_WATTR_SET
* wcolor_set(): HAVE_CURSES_WCOLOR_SET

Add PY_CHECK_CURSES_FUNC_PRIVATE() function to configure.ac.
When running "python -m test" with --tsan or --tsan-parallel,
display the test header (log TSAN_OPTIONS env var).
)

only perform path separator replacement at lstat callsite
…o data (#162032)

Match PEP-3116 specification for Non-blocking I/O.

First proposed in 2015 as `nonblock-none.patch` on gh-57531.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Push NULL and None in GET_AWAITABLE

Every await site compiled to GET_AWAITABLE; PUSH_NULL; LOAD_CONST None;
SEND. GET_AWAITABLE is always followed by that pair, so let it push
(iter, NULL, None) itself. `await f()` now compiles to
CALL; GET_AWAITABLE; SEND, saving two dispatches per await.

The tier-2 optimizer gets an override so the NULL and None slots are
known constants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add NEWS entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Every async for iteration compiled to GET_ANEXT; PUSH_NULL;
LOAD_CONST None; SEND. GET_ANEXT is always followed by that pair, so let
it push (aiter, awaitable, NULL, None) itself, saving two dispatches per
iteration.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Avoid a temporary PyMem_Malloc() buffer: create directly a bytes
object using PyBytesWriter API.
When a test fails with "worker bug" and tests are rerun in verbose
mode, reset worker_bug so that tests are marked as success if the
failed test doesn't fail again when rerun in verbose mode.

TestResult.write_json_into(file) now calls also file.flush().
….json (#161532)

With --with-build-python, the build Python can differ from the target in
patch version or release serial, but version_info and hexversion came from
the running interpreter. Read them from Include/patchlevel.h instead,
falling back to sys.version_info when the header is not there.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…60312)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
)

Py_INCREF(), Py_XINCREF(), Py_DECREF() and Py_XDECREF() are now
implemented as function calls on all limited C API versions.
Previously, they were only implemented as function calls on the
limited C API version 3.12 or newer.

Previously, if a C extension was built with the limited C API version
3.11 or newer, Py_DECREF() was implemented as "op->ob_refcnt--". But
Python 3.12 made Py_DECREF() more complicated to implement immortal
objects in an efficient way. "op->ob_refcnt--" can convert an
immortal object to a mortal object which causes various kinds of
nasty bugs.

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
…ative() (#162268)

Wait for child execve() before creating `RemoteUnwinder`.
Use _target_processing() to sync with the child process.

Co-authored-by: Victor Stinner <vstinner@python.org>
…0619)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…res (#161508)

Include intermediate Future nodes when the remote asyncio unwinder builds awaited-by graphs.
`socket.makefile("rwb")` passes the same raw stream to both sides of a `BufferedRWPair`. When the pair is deallocated, the reader closes the stream before the writer can flush its buffer.

Release the writer first, matching the order in `BufferedRWPair.close()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.