Skip to content

Commit dd2de17

Browse files
aliabid94Ali Abidgradio-pr-bot
authored
Fix windows path issue in FileExplorer (#10735)
* changes * add changeset * Update file_explorer.py * add changeset --------- Co-authored-by: Ali Abid <aliabid94@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
1 parent 3086343 commit dd2de17

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/vast-lines-brush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gradio": patch
3+
---
4+
5+
fix:Fix windows path issue in FileExplorer

gradio/components/file_explorer.py

+2
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,7 @@ def _safe_join(self, folders: list[str]) -> str:
204204
if not folders or len(folders) == 0:
205205
return self.root_dir
206206
combined_path = UserProvidedPath(os.path.join(*folders))
207+
if os.name == "nt":
208+
combined_path = combined_path.replace("\\", "/")
207209
x = safe_join(self.root_dir, combined_path)
208210
return x

0 commit comments

Comments
 (0)