Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"DeprecationWarning: Use of 'SCRAPY_'-prefixed environment variables" always shows #4374

nyov opened this issue Feb 25, 2020 · 0 comments · Fixed by #4375

"DeprecationWarning: Use of 'SCRAPY_'-prefixed environment variables" always shows #4374

nyov opened this issue Feb 25, 2020 · 0 comments · Fixed by #4375


Copy link

nyov commented Feb 25, 2020

ScrapyDeprecationWarning: Use of 'SCRAPY_'-prefixed environment variables to override settings is deprecated.

This deprecation warning can't be shut up inside a project.

def inside_project():
scrapy_module = os.environ.get('SCRAPY_SETTINGS_MODULE')
if scrapy_module is not None:

This is always true, if inside a project. Because of

def init_env(project='default', set_syspath=True):
"""Initialize environment to use command-line tool from inside a project
dir. This sets the Scrapy settings module and modifies the Python path to
be able to locate the project module.
cfg = get_config()
if cfg.has_option('settings', project):
os.environ['SCRAPY_SETTINGS_MODULE'] = cfg.get('settings', project)

We should probably stop "emulating" ENV vars there, and pass this somehow differently.

Additionally, the ScrapyDeprecationWarning for env_overrides is too generic: It never tells you which variable(s) are actually set. This is plain annoying. Please make it more specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging a pull request may close this issue.

1 participant