Skip to content

Commit c0429ca

Browse files
authored
docs: explain why tmp_files are intentionally not cleaned (#450)
Add detailed comment explaining the design decision to not clean temporary scriptlet files, preventing future maintainers from "fixing" this intentional behavior.
1 parent 09d4e32 commit c0429ca

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

executor/python_executor/block.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ class ExecutorOptionsDict(TypedDict):
2323
class ExecutorDict(TypedDict):
2424
options: Optional[ExecutorOptionsDict]
2525

26-
tmp_files = set()
26+
# tmp_files tracks temporary Python files generated from inline 'source' scripts.
27+
# Intentionally NOT cleaned because:
28+
# 1. Preserves source mapping for debugging (stack traces show actual code)
29+
# 2. Scoped to block's .scriptlets directory, cleaned with workspace
30+
# 3. Cleaning during execution could break running imports
31+
tmp_files: set[str] = set()
2732

2833
@dataclass
2934
class ExecutePayload:

0 commit comments

Comments
 (0)