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

Fix #5970 #6082

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix #5970 #6082

wants to merge 4 commits into from

Conversation

buungoo
Copy link

@buungoo buungoo commented Oct 2, 2023

Logs a warning as specified in issue #5970

Fixes #5970

@wRAR
Copy link
Member

wRAR commented Oct 2, 2023

  1. This needs a test.
  2. I think crawl is not the only command where it makes sense.
  3. There should be no need to check EXTENSIONS_BASE, you should use settings.getwithbase("EXTENSIONS") to get the final setting value.

@vishesh10
Copy link
Contributor

  1. This needs a test.
  2. I think crawl is not the only command where it makes sense.
  3. There should be no need to check EXTENSIONS_BASE, you should use settings.getwithbase("EXTENSIONS") to get the final setting value.

Hi @wRAR,
The problem with settings.getwithbase("EXTENSIONS") is that it is not able to read the overridden values using custom_settings. It can only read values from settings.py file. Is there any other way to get the updated settings?

I have disabled the FeedExporter using custom_settings in the spider file:

custom_settings = { 
        "EXTENSIONS": {
            "scrapy.extensions.feedexport.FeedExporter": None
        },  
    } 

and the logs confirm the same that the FeedExporter is not coming in the enabled extensions

[scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
 'scrapy.extensions.telnet.TelnetConsole',
 'scrapy.extensions.memusage.MemoryUsage',
 'scrapy.extensions.logstats.LogStats']

but when I write build_component_list(settings.getwithbase("EXTENSIONS")) in the crawl.py, it still prints the FeedExporter extension. Is there any other way to read the updated settings?

Additionally, the overridden_settings method is also not able to give me the updated value.

Thanks

@wRAR
Copy link
Member

wRAR commented May 11, 2024

Do you mean your existing code works in that case?

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

Successfully merging this pull request may close these issues.

Emit a warning if options -o or -O are specified when FeedExporter is disabled
3 participants