Skip to content

Conversation

@ivonastojanovic
Copy link

@ivonastojanovic ivonastojanovic commented Apr 17, 2025

Add a developer-facing document describing the protocol used by :func:remote_exec(pid, script) to execute Python code in a running process. This is intended to guide debugger and tool authors in reimplementing the protocol.


📚 Documentation preview 📚: https://cpython-previews--99.org.readthedocs.build/

mpage and others added 30 commits April 1, 2025 14:53
This should have been done as part of 053c285 but got blown away
in a merge.
)

Use relaxed atomics in hash of `frozenset` to fix TSAN warning.
…ythonGH-131948)

* Parse down to statement level in the cases generator

* Add handling for #if macros, treating them much like normal ifs.
…n#132020)

Add 'function' parameter to check_sanitizer() of test.support.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
…ython#128930)

It doesn't make sense to use a deprecation for evaluate_forward_ref,
as it is a new function in Python 3.14 and doesn't have compatibility
guarantees.

I considered making it throw an error if type_params it not passed and
there is no owner. However, I think this is too unfriendly for users. The
case where this param is really needed is fairly esoteric and I don't think
this case is worth the pain of forcing users to write "type_params=()".
…obust (python#132039)

Should work also if the version string includes a commit hash, like `perf version 6.12.9.g242e6068fd5c`
…al.h (pythongh-131289)

Use `_AddressOfReturnAddress` in `_Py_get_machine_stack_pointer` to silence MSVC warning in pycore_ceval.h for release builds.
A bunch of other warnings in typing.py were already deferred, but
I added a few non-lazy ones.
sobolevn and others added 24 commits April 16, 2025 12:39
Co-authored-by: Diego Russo <diego.russo@arm.com>
…2571)

I started with just moving ForwardRefTests to test_annotationlib,
but found that it contained a number of tests for no_type_check, which
I moved to a new class in test_typing, as well as a number of tests that
are more appropriately classified as tests for get_type_hints().

One test, test_forward_equality_namespace(), was somewhat accidentally
depending on a global class A in test_typing. I added a class A in the
annotationlib tests instead.

Also add a useful comment in annotationlib.
…132594)

* Don't call close() if the file descriptor is negative.
* If close() fails, chain the existing exception.
…k` (python#132534)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…H-130251)

Previously it was only called in binary pow() and the binary
power operator.
… `_BUILD_LIST`, `_BUILD_SLICE`, and `_BUILD_MAP` (pythonGH-132434)

---------

Signed-off-by: Manjusaka <me@manjusaka.me>
- Explicitly say that isinstance/issubclass do not work on non-runtime checkable
  protocols.
- Move the sentence "This raises TypeError when applied to a non-protocol class". It
  took me quite some time to decide what "this" was here: it refers to applying the
  decorator, not to an isinstance() call.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…2611)

When the `showwarning()` function is replaced, make sure to restore
it after the test finishes.  Add a timeout for `Barrier()` so we
don't hang for a long time if something goes wrong.
…lazy (python#132614)

This ensures that if we jump through some hoops to make sure something is imported
lazily, we don't regress on importing it.

I recently already accidentally made typing import warnings and annotationlib eagerly.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
…path (python#130071)

Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled)
for `exec` when the `source` argument is a string and the `closure` argument is not `None`.

Co-authored-by: sobolevn <mail@sobolevn.me>
…od (python#132586)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@pablogsal pablogsal self-assigned this Apr 17, 2025
Add a developer-facing document describing the protocol used by
remote_exec(pid, script) to execute Python code in a running process.
This is intended to guide debugger and tool authors in reimplementing
the protocol.
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.