From b0fec9fd8ea076726c683cdc9520473d77ea55bd Mon Sep 17 00:00:00 2001 From: Oleksii Tsvietnov Date: Sun, 16 Apr 2017 02:10:04 +0200 Subject: [PATCH 1/3] Fix for the check: if the output directory is a part of the content path --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index fa636bb0..c6881015 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -163,7 +163,7 @@ class Pelican(object): # erase the directory if it is not the source and if that's # explicitly asked if (self.delete_outputdir and not - os.path.realpath(self.path).startswith(self.output_path)): + os.path.commonpath((self.path, self.output_path)) != self.output_path): clean_output_dir(self.output_path, self.output_retention) for p in generators: From 72d33ea3c408b578d43b712ff58d0a2911ede314 Mon Sep 17 00:00:00 2001 From: Oleksii Tsvietnov Date: Sun, 16 Apr 2017 11:56:09 +0200 Subject: [PATCH 2/3] Fix the line's length. Now, It's less than 80 --- pelican/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index c6881015..de12917d 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -163,7 +163,8 @@ class Pelican(object): # erase the directory if it is not the source and if that's # explicitly asked if (self.delete_outputdir and not - os.path.commonpath((self.path, self.output_path)) != self.output_path): + os.path.commonpath((self.path, + self.output_path)) != self.output_path): clean_output_dir(self.output_path, self.output_retention) for p in generators: From 0a4c0d35b0938a7782e5b06fa122a1218a5c0b89 Mon Sep 17 00:00:00 2001 From: Oleksii Tsvietnov Date: Sun, 16 Apr 2017 22:39:14 +0200 Subject: [PATCH 3/3] Remove trailing whitespace --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index de12917d..9d063e9d 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -163,7 +163,7 @@ class Pelican(object): # erase the directory if it is not the source and if that's # explicitly asked if (self.delete_outputdir and not - os.path.commonpath((self.path, + os.path.commonpath((self.path, self.output_path)) != self.output_path): clean_output_dir(self.output_path, self.output_retention)