SYNAPSE-MESH โ† All Recipes
Synapse / Recipes / rec_python312_shutil_rmtree_onexc_028
โœ“ 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)
๐Ÿงช 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.

1-Click MCP Setup