New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: ..
in filename throwing error while loading in output.
#7795
Bugfix: ..
in filename throwing error while loading in output.
#7795
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/c205c1df0cff21d68e01474907e1fd6e0d36daad/gradio-4.23.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@c205c1df0cff21d68e01474907e1fd6e0d36daad#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
..
in filename throwing error while loading in output.
@abidlabs This is a small bugfix, and ready for review. Let me know if you have any questions. |
parent to compare
…adio into fix-video-filename-issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shubhamofbce for addressing comments! CC @abidlabs prior to merge
Hmm let me take a look at these tests |
So the docstring for Line 1079 in 2f12512
So I slightly refactored the implementation to be a little more explicit what we are testing. Also added a unit test. |
Nice LGTM @abidlabs ! |
Thanks @shubhamofbce for the original PR identifying the cause of the issue and @freddyaboulton for reviewing the fix. Will merge in after CI |
Description
We were checking if
..
in file path to prevent path traversal, but we need to exclude filename while checking this otherwise it will return false if filename has dots in it. So I have updated the function to check path without filename.Closes: #7755
🎯 PRs Should Target Issues
Not adhering to this guideline will result in the PR being closed.