Skip to content

Keep local absolute paths out of stored error text - #22

Merged
abrignoni merged 1 commit into
mainfrom
fix/scrub-local-paths-from-error-text
Sep 3, 2026
Merged

abrignoni merged 1 commit into
mainfrom
fix/scrub-local-paths-from-error-text

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Keeps the examiner's local paths out of stored error text.

Pillow and the OSError family name the file they were handed, and that text was stored as is in files.error and reached the reports and exports. The row already identifies the file, so the message keeps the exception type and the non-path part of its text.

  • imaging.scrub_local_paths: removes a known path in every spelling a message can carry, and anything shaped like an absolute path (POSIX, Windows drive, UNC, quoted or bare)
  • describe_failure and the video hashing OSError site go through it
  • tests/test_error_text.py: both sites with real Pillow and OSError messages, the Windows and UNC shapes, and one end-to-end run on synthetic files; each stored-text test fails against the previous code

The reference-mode archive branch adds two more sites (the "source archive unavailable" messages name the zip); route those through the same helper when it merges.

🤖 Generated with Claude Code

Pillow's UnidentifiedImageError and the OSError family name the file they were
handed, and describe_failure's fallback stored that text as is in files.error,
where it reaches the HTML, CSV and JSON reports and the exports. The path is the
case folder for a staged or on-demand copy and the evidence mount otherwise.

imaging.scrub_local_paths removes a known path in every spelling a message can
carry (either separator, a repr's doubled backslashes) and anything else shaped
like an absolute path, quoted or bare: POSIX, Windows drive, UNC. describe_failure
and the video hashing OSError site in the pipeline go through it; the row already
identifies the file, so the message keeps the exception type and the non-path
part of its text.

tests/test_error_text.py covers both sites with real Pillow and OSError messages,
the Windows and UNC shapes as strings, and one end-to-end run of the pipeline on
synthetic bad files. Each stored-text test fails against the previous code.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@abrignoni
abrignoni merged commit 856ba17 into main Sep 3, 2026
8 checks passed
@abrignoni
abrignoni deleted the fix/scrub-local-paths-from-error-text branch September 3, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant