From b2cf37bb8f93b240a654b591044e332c993bfab4 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Wed, 22 Jun 2022 16:05:08 +0200 Subject: [PATCH] is_hidden: Use normalized paths --- 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):