Skip to content

Fix asset filename truncation to account for assets/ prefix - #1069

Open
guoyuxiao946b wants to merge 1 commit into
pytest-dev:masterfrom
guoyuxiao946b:fix/issue-906-asset-filename-prefix
Open

Fix asset filename truncation to account for assets/ prefix#1069
guoyuxiao946b wants to merge 1 commit into
pytest-dev:masterfrom
guoyuxiao946b:fix/issue-906-asset-filename-prefix

Conversation

@guoyuxiao946b

Copy link
Copy Markdown

When extras are written to disk, _asset_filename truncated names to max_asset_filename_length (default 255) and Report._write_content then joined them with the assets/ directory. The relative path could exceed the configured limit and fail on Windows MAX_PATH.

Reserve the assets directory name plus separator when truncating. Self-contained reports do not write an assets directory and are unchanged.

Closes #906

Made with Cursor

Reserve the assets directory prefix when truncating extra filenames
so relative paths stay within max_asset_filename_length.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

_max_asset_filename_length of BaseReport does not account for prefixed 'assets/'

1 participant