Fix URL encoding in content accessor by replacing quote_plus with quote for file URLs#2542
Merged
FredLL-Avaiga merged 5 commits intoAvaiga:developfrom Apr 8, 2025
Conversation
This commit introduces a new test case to verify the functionality of file downloads when the file path contains spaces. The test creates a temporary file, sets the content variable in the GUI, and checks the generated markdown string against expected output, ensuring proper URL encoding for spaces.
Contributor
Author
|
Hey @FredLL-Avaiga i have added test , please verify |
FredLL-Avaiga
requested changes
Apr 7, 2025
… path with spaces This commit modifies the expected output in the test for file downloads to ensure the correct URL is generated when the file path contains spaces. The change updates the defaultContent attribute to include the proper path format.
…m-pranshugupta01:pranshugupta01/taipy into bug/Avaiga#2523-file-download-with-spaces
FredLL-Avaiga
approved these changes
Apr 8, 2025
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.
What type of PR is this? (Check all that apply)
Description
This PR fixes an issue with the file_download control when file names contain spaces. Previously, spaces in filenames were encoded as
+characters (usingurllib.parse.quote_plus), which caused browsers to fail to locate the files. This PR changes the URL encoding to useurllib.parse.quoteinstead, which properly encodes spaces as%20in URLs, allowing files with spaces in their names to be downloaded correctly.Related Tickets & Documents
How to reproduce the issue
Backporting
This change should be backported to:
Checklist
We encourage keeping the code coverage percentage at 80% or above.
If not, explain why:
If not, explain why:
If not, explain why:
If not, explain why: