From 10074d3622fdba9caaf83ab6fe02f60db9b3a88b Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 4 Jun 2014 22:48:08 -0500 Subject: [PATCH] Fix linking issue to directories in file module The os.path.isdir() returns True for symlinks that point to directories, so we also need to check to make sure it's not a symlink too. Fixes #7657 --- library/files/file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/files/file b/library/files/file index d2a20dbb7a5..29c491b7662 100644 --- a/library/files/file +++ b/library/files/file @@ -182,7 +182,7 @@ def main(): elif state in ['link','hard']: - if os.path.isdir(path): + if os.path.isdir(path) and not os.path.islink(path): relpath = path else: relpath = os.path.dirname(path)