Skip to content

FIX handle converter preview path inspection errors - #2427

Open
Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-converter-base64-handling
Open

FIX handle converter preview path inspection errors#2427
Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-converter-base64-handling

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Converter previews inspect *_path media values to distinguish existing local files from raw base64. Some runtime and filesystem combinations can raise OSError or ValueError while inspecting long or invalid path-like values, causing preview serialization to fail before the media is persisted.

Treat only those filesystem inspection failures as a non-path result and continue through the existing raw base64 persistence path. Existing local files, URLs, and data URIs retain their current behavior, while serializer and converter errors still propagate.

Tests and Documentation

  • Added coverage for long raw base64 media and response serialization.
  • Added deterministic coverage for OSError and ValueError path inspection failures.
  • Added coverage that invalid base64 errors still propagate and existing local files remain unchanged.
  • Ran targeted backend tests: 120 passed, 4 skipped.
  • Ran Ruff check and format check on the changed files.
  • Documentation and JupyText: N/A.

Treat filesystem inspection failures as raw media data while preserving serializer errors and existing local file paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hannahwestra25 hannahwestra25 self-assigned this Aug 19, 2026
Comment on lines +202 to +203
except (OSError, ValueError):
is_existing_file = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't there be a value error or os error that is not related to the file existing ?

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.

3 participants