From e30c28eeba5ac1ee18eb6027bfb67c91afaf2f51 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Thu, 25 Feb 2016 02:06:15 -0600 Subject: [PATCH] Updated same_file to check for same device --- notebook/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notebook/utils.py b/notebook/utils.py index c472367b2..fa083b029 100644 --- a/notebook/utils.py +++ b/notebook/utils.py @@ -156,7 +156,10 @@ def same_file(path, other_path): ----------- same: Boolean that is True if both path and other path are the same """ - return os.stat(path).st_ino == os.stat(other_path).st_ino + path_stat = os.stat(path) + other_path_stat = os.stat(other_path) + return (path_stat.st_ino == other_path_stat.st_ino and + path_stat.st_dev == other_path_stat.st_dev) def to_os_path(path, root=''): """Convert an API path to a filesystem path