Commit 50ff71a
committed
refactor(processing): move tmp_dir lifecycle management to CLI
Move temporary directory creation and cleanup from ExtractionConfig to
CLI to make the lifecycle explicit and prevent unintended cleanup.
The implicit atexit cleanup in ExtractionConfig could unexpectedly
remove user-provided directories. This change moves that responsibility
to the CLI layer where it's visible and under explicit control.
Changes:
- ExtractionConfig.tmp_dir defaults to system temp (no auto-cleanup)
- Renamed tmp_dir() context manager to task_tmp_dir()
- task_tmp_dir() creates and cleans up task-specific subdirectories
- CLI explicitly creates unblob temp directory and manages cleanup
- Tests updated for proper sandbox isolation
Result: Library code has no implicit cleanup. CLI owns the lifecycle.
Users can safely provide their own tmp_dir without cleanup surprises.1 parent fa60c91 commit 50ff71a
File tree
4 files changed
+49
-22
lines changed- python/unblob
- tests
4 files changed
+49
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
366 | 371 | | |
367 | 372 | | |
368 | 373 | | |
| |||
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
| 390 | + | |
385 | 391 | | |
386 | 392 | | |
387 | 393 | | |
388 | 394 | | |
389 | 395 | | |
390 | 396 | | |
391 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
392 | 409 | | |
393 | 410 | | |
394 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 106 | + | |
122 | 107 | | |
123 | 108 | | |
124 | 109 | | |
| |||
247 | 232 | | |
248 | 233 | | |
249 | 234 | | |
250 | | - | |
251 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
252 | 243 | | |
253 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
254 | 249 | | |
| 250 | + | |
255 | 251 | | |
256 | 252 | | |
257 | | - | |
258 | | - | |
| 253 | + | |
| 254 | + | |
259 | 255 | | |
| 256 | + | |
260 | 257 | | |
261 | 258 | | |
262 | 259 | | |
263 | 260 | | |
264 | 261 | | |
265 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
266 | 273 | | |
267 | 274 | | |
268 | 275 | | |
| |||
281 | 288 | | |
282 | 289 | | |
283 | 290 | | |
284 | | - | |
| 291 | + | |
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
276 | 277 | | |
277 | | - | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
0 commit comments