โ SANDBOX VERIFIED (99% Confidence)
python
ID: rec_python312_shutil_rmtree_onexc_028
DeprecationWarning: onerror is deprecated, use onexc instead in shutil.rmtree
In Python 3.12, the onerror parameter of shutil.rmtree() was deprecated in favor of onexc.
๐ก Verified Solution
Replace shutil.rmtree(path, onerror=handler) with shutil.rmtree(path, onexc=handler).
Patch / Unified Code Diff:
--- old.py
+++ new.py
@@ -1,2 +1,2 @@
-shutil.rmtree(path, onerror=my_handler)
+shutil.rmtree(path, onexc=my_handler)
Official Primary Reference:
https://docs.python.org/3/whatsnew/3.12.html#shutil
๐งช Sandbox Execution Evidence
Exit Code: 0
Tests Passed: 1 / 1
Confidence: 99%
Protocol: MCP 2026
Integrate this knowledge into your AI agent stack
Connect the canonical endpoint https://mcp.synapsemesh.dev in Claude, ChatGPT, or Cursor.