From bc6b77133525e4a724eeee6e244e404161cf9e41 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Wed, 22 Jun 2022 23:23:02 +0200 Subject: [PATCH] is_hidden: Use normalized paths (#271) --- jupyter_core/paths.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jupyter_core/paths.py b/jupyter_core/paths.py index 6c3a348..f2716a8 100644 --- a/jupyter_core/paths.py +++ b/jupyter_core/paths.py @@ -384,7 +384,10 @@ def is_hidden(abs_path, abs_root=""): The absolute path of the root directory in which hidden directories should be checked for. """ - if os.path.normpath(abs_path) == os.path.normpath(abs_root): + abs_path = os.path.normpath(abs_path) + abs_root = os.path.normpath(abs_root) + + if abs_path == abs_root: return False if is_file_hidden(abs_path):