fix(gateway): parse MEDIA: tags with Windows paths (#28989)#29234
Closed
Jiahui-Gu wants to merge 1 commit into
Closed
fix(gateway): parse MEDIA: tags with Windows paths (#28989)#29234Jiahui-Gu wants to merge 1 commit into
Jiahui-Gu wants to merge 1 commit into
Conversation
Collaborator
Contributor
Author
|
Closing in favor of #28991 (#28991 also fixes extract_local_files(), more complete coverage). Thanks @alt-glitch for the duplicate detection — releasing review bandwidth so reviewers can focus on the earlier PR. |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #28989.
MEDIA:tag extraction ingateway/platforms/base.py:2162used the path prefix pattern(?:~/|/), which only matched POSIX-style absolute / home paths. Windows paths likeC:/Users/foo/img.pngandC:\Users\foo\img.pngdid not match, soextract_media()returned empty and the rawMEDIA:C:\...text was forwarded as plain text instead of being attached as an image.Fix
gateway/platforms/base.py: extendmedia_patternpath prefix to(?:~/|/|[A-Za-z]:[/\\]), coveringC:/...(forward slash) andD:\...(backslash) drive-letter paths on Windows. Existing POSIX paths still match.Test plan
test_media_tag_supports_windows_forward_slash_pathandtest_media_tag_supports_windows_backslash_pathintests/gateway/test_platform_base.py~) all match correctly🤖 Generated with Claude Code