From a15f2aba76cc613e134579be299c647057e834cd Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 30 Apr 2020 21:05:47 +0200 Subject: [PATCH] Ensure path & output path comparisons are absolute Otherwise, the following error could be returned: "ValueError: Can't mix absolute and relative paths" --- pelican/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 40a222ae..0cfb4841 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -100,8 +100,9 @@ class Pelican: # Delete the output directory if (1) the appropriate setting is True # and (2) that directory is not the parent of the source directory if (self.delete_outputdir - and os.path.commonpath([self.output_path]) != - os.path.commonpath([self.output_path, self.path])): + and os.path.commonpath([os.path.realpath(self.output_path)]) != + os.path.commonpath([os.path.realpath(self.output_path), + os.path.realpath(self.path)])): clean_output_dir(self.output_path, self.output_retention) for p in generators: