Add python 3.15 to tests - #2069
Conversation
Verify that an exception already reported as unhandled remains recognized after a nested exception replaces the transient exception state. This prevents the original exception from being reported twice.
Track the identity of an exception once it has been reported as unhandled so that nested exceptions cannot cause it to be reported again. Clear the transient exception state before stopping while retaining the reported exception tag for the remainder of its unwind. This fixes duplicate SystemExit stops exposed by Python 3.15, where traceback formatting can trigger a nested monitored exception while resolving its lazy _colorize import.
Regenerate the .pyx and .c files from the modified _pydevd_sys_monitoring.py implementation.
Python 3.15 propagates the multithreaded os.fork() DeprecationWarning as an exception when warnings are configured as errors. Debuggee test sessions set PYTHONWARNINGS=error, and debugpy's worker threads cause CPython to emit this warning during the multiprocessing fork tests. The child process has already been created when the warning is raised in the parent. This terminates the parent while the child is attaching, resulting in premature terminated events or test timeouts. Ignore only this specific warning when the test intentionally uses the fork start method. Other warnings remain errors, and spawn-based tests are unaffected.
|
The tests are all passing now. There were 2 issues uncovered by updating to 3.15. The smaller issue was that there was a deprecation warning for calling This was fixed by adding a step in those tests to ignore that specific deprecation warning since those tests were specifically testing The larger issue involved duplicate exception stops when using the While pydevd was processing the first unhandled When execution continued, the original This second issue was fixed by tracking an already-reported exception separately from the temporary state used to find its unhandled boundary. Nested exceptions then can replace the temporary state, but won't erase the record that the original exception has already caused a debugger stop. Also, a test was added to check this specific bug instead of relying on it incidentally getting triggered by an unrelated change in the timing of when a module gets imported. |
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
|
Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Result: Summary: Verification could not run because no trusted sandbox image is configured for `microsoft/debugpy`. The PR adds one regression test for repeated unhandled-exception reporting in the pure-Python monitoring implementation. No executable pass/fail signal was obtained. Coverage is still missing for the parallel Cython implementation and Python 3.15 attach-version detection. Test runs: 1 not run
|
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
This MR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [debugpy](https://aka.ms/debugpy) ([source](https://github.com/microsoft/debugpy)) | dev | patch | `1.8.21` → `1.8.22` | [](https://securityscorecards.dev/viewer/?uri=github.com/microsoft/debugpy) | --- ### Release Notes <details> <summary>microsoft/debugpy (debugpy)</summary> ### [`v1.8.22`](https://github.com/microsoft/debugpy/releases/tag/v1.8.22): debugpy v1.8.22 [Compare Source](microsoft/debugpy@v1.8.21...v1.8.22) ##### Fixes - Fix invalid type annotation in test\_pydev\_monkey comprehension by [@​pdepetro](https://github.com/pdepetro) in [#​2033](microsoft/debugpy#2033) - Fix PEP 768 code injection SyntaxError when temp path contains backslashes by [@​rchiodo](https://github.com/rchiodo) with [@​Copilot](https://github.com/Copilot) in [#​2038](microsoft/debugpy#2038) - Fix race between adapter connection publication and session attachment by [@​aperez](https://github.com/aperez) in [#​2049](microsoft/debugpy#2049) - Fix debugger hang when expanding objects with blocking property getters ([#​2053](microsoft/debugpy#2053)) by [@​rchiodo](https://github.com/rchiodo) in [#​2055](microsoft/debugpy#2055) - Fix duplicate stopped event when two threads hit a breakpoint at once by [@​aperez](https://github.com/aperez) in [#​2056](microsoft/debugpy#2056) - Avoid exceptions in environment diagnostics by [@​rchiodo](https://github.com/rchiodo) in [#​2059](microsoft/debugpy#2059) - Fix thread identity when the first traced call is another thread's is\_alive() by [@​aperez](https://github.com/aperez) in [#​2061](microsoft/debugpy#2061) - Respect isolated mode when patching sys.path by [@​karandhaodiyal28-hash](https://github.com/karandhaodiyal28-hash) in [#​2050](microsoft/debugpy#2050) ##### Enhancements - Add trigger\_exception\_handler() for post-mortem debugging of caught exceptions by [@​nshepperd](https://github.com/nshepperd) in [#​1996](microsoft/debugpy#1996) - Add lldb attach-to-PID option for debugpy on Linux by [@​pdepetro](https://github.com/pdepetro) in [#​2052](microsoft/debugpy#2052) - Populate hitBreakpointIds in the DAP stopped event by [@​aperez](https://github.com/aperez) in [#​2060](microsoft/debugpy#2060) - Return the endpoint from listen() with the in-process adapter by [@​karandhaodiyal28-hash](https://github.com/karandhaodiyal28-hash) in [#​2051](microsoft/debugpy#2051) ##### Infrastructure work - Add Dependabot configuration for pip and GitHub Actions by [@​rchiodo](https://github.com/rchiodo) in [#​2041](microsoft/debugpy#2041) - Update vendored pydevd 3.4.1 -> 3.5.0 (maintenance refresh) by [@​rchiodo](https://github.com/rchiodo) in [#​2044](microsoft/debugpy#2044) - Pin secure test dependency floors and drop EOL Python 3.9/3.8 by [@​rchiodo](https://github.com/rchiodo) in [#​2045](microsoft/debugpy#2045) - Add more typing to debugpy and switch to 'standard' type checking mode by [@​rchiodo](https://github.com/rchiodo) in [#​1637](microsoft/debugpy#1637) - Add debugpy release agent by [@​rchiodo](https://github.com/rchiodo) in [#​2062](microsoft/debugpy#2062) - Pin GitHub Actions to full-length commit SHAs by [@​danfiedler-msft](https://github.com/danfiedler-msft) in [#​2063](microsoft/debugpy#2063) - Add python 3.15 to tests by [@​finnagin](https://github.com/finnagin) in [#​2069](microsoft/debugpy#2069) Thanks to [@​pdepetro](https://github.com/pdepetro), [@​rchiodo](https://github.com/rchiodo), [@​nshepperd](https://github.com/nshepperd), [@​aperez](https://github.com/aperez), [@​karandhaodiyal28-hash](https://github.com/karandhaodiyal28-hash), [@​danfiedler-msft](https://github.com/danfiedler-msft), and [@​finnagin](https://github.com/finnagin) for the commits. **Full Changelog**: <microsoft/debugpy@v1.8.21...v1.8.22> </details> --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMDMuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjEwMy41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> See merge request swiss-armed-forces/cyber-command/cea/loom!814
No description provided.