From 3040f77468d7dd997afd2f8a35590cafaff454af Mon Sep 17 00:00:00 2001 From: Shivam Sandbhor Date: Thu, 8 Aug 2019 17:28:22 +0530 Subject: [PATCH] [MRG+1] Update project.py removed one 'hack', seems irrelevant. (#3910) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update project.py removed one 'hack', seems irrelevant. As mentioned by @Gallaecio in issue #3871, the 'hack' is cleared. I also double checked whether the environment variable "SCRAPY_PICKLED_SETTINGS_TO_OVERRIDE" was ever set in our codebase and it turns out we didn't set it or used it anywhere else.So I guess the 'hack' was not used in the current version. Also the name of this environment variable rather doesn't suggest it was a boolean(it is used in an 'if' condition which has perplexed me ) * Update project.py * Update project.py How about this? * Update project.py * Update project.py * Update scrapy/utils/project.py Co-Authored-By: Adrián Chaves * Update scrapy/utils/project.py Co-Authored-By: Adrián Chaves * Update project.py --- scrapy/utils/project.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrapy/utils/project.py b/scrapy/utils/project.py index 95c6a8035..1cbda141a 100644 --- a/scrapy/utils/project.py +++ b/scrapy/utils/project.py @@ -8,6 +8,7 @@ from os.path import join, dirname, abspath, isabs, exists from scrapy.utils.conf import closest_scrapy_cfg, get_config, init_env from scrapy.settings import Settings from scrapy.exceptions import NotConfigured +from scrapy.exceptions import ScrapyDeprecationWarning ENVVAR = 'SCRAPY_SETTINGS_MODULE' DATADIR_CFG_SECTION = 'datadir' @@ -70,6 +71,9 @@ def get_project_settings(): # XXX: remove this hack pickled_settings = os.environ.get("SCRAPY_PICKLED_SETTINGS_TO_OVERRIDE") if pickled_settings: + warnings.warn("Use of environment variable " + "'SCRAPY_PICKLED_SETTINGS_TO_OVERRIDE' " + "is deprecated.", ScrapyDeprecationWarning) settings.setdict(pickle.loads(pickled_settings), priority='project') # XXX: deprecate and remove this functionality