Removes special characters from temporary filenames#2480
Conversation
|
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2480-all-demos |
freddyaboulton
left a comment
There was a problem hiding this comment.
Looks good to me @abidlabs ! Thanks for the fix.
|
Thanks for the review @freddyaboulton! Used this excuse to organize the |
|
I am curious if there is any way to still get the special characters out of the file names with fileobj.name? If I want my application to be able to upload that same file to other resources such Azure Storage Explorer I need to be able to access the original file name but the current workflow appears to remove special characters such as the "()" in test_file(1).txt. |
|
Not possible at the moment @ColtonBehannon since these are stripped. Is it possible for you to strip the same special characters on your end to reconcile the file names? |
|
@abidlabs Thanks for the quick response! I think that could work though I'm not sure what all characters are considered special in this context and would need to be stripped. For example, are underscores included as well or not. Any suggestions here other than testing them all? |
|
Here's the logic: gradio/client/python/gradio_client/utils.py Line 421 in 52f7831 so yes underscores are valid |
Removes special characters from temporary filenames so that the files can be served by components.
Closes: #2468