Repository navigation
merging into my modded python. thank you for helping me - #1
Open
sidlovescoding wants to merge 232 commits into
Open
sidlovescoding wants to merge 232 commits into
sidlovescoding wants to merge 232 commits into
Conversation
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>
…()` (#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>
…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>
* 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.
#161567) Add utils.cleanup_test_name() function.
…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.
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.
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).
* 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>
…e queued for BRC merging (#162316)
…60312) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…r a cancelled wait_closed() (#162317)
) 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>
…yMem_FreeDelayed()` (#160698)
…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()`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.