From a1b966edf761a20ef30e688b1ea1641a5ef1c860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9A=E5=95=A6b=E6=A2=A6?= <1715109585@qq.com> Date: Tue, 12 Dec 2023 04:31:34 +0800 Subject: [PATCH] Fixed an issue where files could not be filed (#6754) * Fixed an issue where files could not be filed * add changeset --------- Co-authored-by: gradio-pr-bot --- .changeset/slimy-socks-enter.md | 5 +++++ gradio/components/file_explorer.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/slimy-socks-enter.md diff --git a/.changeset/slimy-socks-enter.md b/.changeset/slimy-socks-enter.md new file mode 100644 index 0000000000000..f28da6d65f253 --- /dev/null +++ b/.changeset/slimy-socks-enter.md @@ -0,0 +1,5 @@ +--- +"gradio": patch +--- + +fix:Fixed an issue where files could not be filed diff --git a/gradio/components/file_explorer.py b/gradio/components/file_explorer.py index e25f33c2b9740..04aa6a5001ef7 100644 --- a/gradio/components/file_explorer.py +++ b/gradio/components/file_explorer.py @@ -197,7 +197,7 @@ def make_node(parts, tree): ignore_files = [] if self.ignore_glob: for result in expand_braces(self.ignore_glob): - ignore_files += list(Path(self.ignore_glob).resolve().glob(result)) + ignore_files += list(Path(self.root).resolve().glob(result)) files = list(set(files) - set(ignore_files)) tree = make_tree([str(f.relative_to(self.root)) for f in files])