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

MRG+1 fixed FeedExporter shutdown log messages #1240

Merged
merged 1 commit into from May 18, 2015
Merged

Conversation

@kmike
Copy link
Member

@kmike kmike commented May 18, 2015

logfmt % "Stored" happens before logger formats the message, so % vs %% needs to be reversed.

This fixes the following error during shutdown:

2015-05-18 19:21:45+0500 [scrapy] ERROR: Error caught on signal handler: <bound method ?.close_spider of <scrapy.extensions.feedexport.FeedExporter object at 0x10c7ea390>>
Traceback (most recent call last):
 File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/twisted/internet/defer.py", line 577, in _runCallbacks
   current.result = callback(current.result, *args, **kw)
 File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/Scrapy-0.25.1-py2.7.egg/scrapy/extensions/feedexport.py", line 187, in <lambda>
   d.addErrback(lambda f: logger.error(logfmt % "Error storing", log_args,
TypeError: format requires a mapping

Export is successful, but error handler is called because there is the same exception in success handler.

To get it try @eliasdorneles's example from here: scrapy/scrapy.org#29 (scrapy runspider example.py -o res.json)

@kmike kmike added this to the Scrapy 1.0 milestone May 18, 2015
@eliasdorneles eliasdorneles changed the title fixed FeedExporter shutdown log messages MRG+1 fixed FeedExporter shutdown log messages May 18, 2015
@eliasdorneles
Copy link
Member

@eliasdorneles eliasdorneles commented May 18, 2015

thanks, @kmike :)

curita added a commit that referenced this pull request May 18, 2015
MRG+1 fixed FeedExporter shutdown log messages
@curita curita merged commit 044f31c into master May 18, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@dangra dangra deleted the fix-feedexport-logging branch May 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants