3 ms·
Just to clarify, this requires both the client and the debugging script to be running 3.14? So I cannot have a script running an older version of Python but use
by whinvik 1y ago
Just to clarify, this requires both the client and the debugging script to be running 3.14? So I cannot have a script running an older version of Python but use a Python 3.14 debug script to attach to the running script?
- joshlk 1y agoYes
- rtpg 1y agoSo Python 3.14 introduces this functionality. The process you want to debug needs to be on at least Python 3.14. If you want to "just" use sys.remote_exec, you will need to use that from a matching Python version. If you dive into the implementation (check out the PEP), you could most definitely write a C or Rust program that implements remote_exec and "does the thing". The protocol is basically "tell the program to read a python script from this file". That python script will be executed in the running program's environment, but you don't need for the software on the other side to be a python program! sys.remote_exec itself only targets same Python versions though.
- skeledrew 1y agoYou can check out pyrasite[0], which does the same and works in theoretically all relevant Python versions, without need to version match. [0] https://pyrasite.readthedocs.io https://pyrasite.readthedocs.io