Fix uploaded file wasn't moved to custom temp dir at different disks (#6565)

* Fix uploaded file wasn't moved to custom temp dir at different disks

* add changeset

* Update routes.py

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
This commit is contained in:
Dody Suria Wijaya 2023-11-28 17:58:55 +07:00 committed by GitHub
parent 315659817e
commit 9bf1ad43ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": minor
---
feat:Fix uploaded file wasn't moved to custom temp dir at different disks

View File

@ -783,7 +783,7 @@ class App(FastAPI):
os.rename(temp_file.file.name, dest)
except OSError:
files_to_copy.append(temp_file.file.name)
locations.append(temp_file.file.name)
locations.append(str(dest))
output_files.append(dest)
if files_to_copy:
bg_tasks.add_task(