From 8e4947ef0dd4bad368784f0d56e6b0f675ea2a18 Mon Sep 17 00:00:00 2001 From: Elias Dorneles Date: Tue, 3 Nov 2015 15:46:05 -0200 Subject: [PATCH] make utils.project.data_path return path unmodified when outside project --- scrapy/utils/project.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scrapy/utils/project.py b/scrapy/utils/project.py index a15a0d90f..9258469ee 100644 --- a/scrapy/utils/project.py +++ b/scrapy/utils/project.py @@ -40,10 +40,10 @@ def project_data_dir(project='default'): return d def data_path(path, createdir=False): - """If path is relative, return the given path inside the project data dir, - otherwise return the path unmodified + """If inside the project and path is relative, return the given path + as relative the project data dir, otherwise return it unmodified """ - if not isabs(path): + if inside_project() and not isabs(path): path = join(project_data_dir(), path) if createdir and not exists(path): os.makedirs(path)