We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When running a contract with a URL that returns non-200 response, I get the following:
2018-08-09 14:40:23 [scrapy.core.scraper] ERROR: Spider error processing <GET https://www.bureauxlocaux.com/annonce/a-louer-bureaux-a-louer-a-nantes--1289-358662> (referer: None) Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks current.result = callback(current.result, *args, **kw) File "/usr/local/lib/python3.6/site-packages/scrapy/contracts/__init__.py", line 89, in eb_wrapper results.addError(case, exc_info) File "/usr/local/lib/python3.6/unittest/runner.py", line 67, in addError super(TextTestResult, self).addError(test, err) File "/usr/local/lib/python3.6/unittest/result.py", line 17, in inner return method(self, *args, **kw) File "/usr/local/lib/python3.6/unittest/result.py", line 115, in addError self.errors.append((test, self._exc_info_to_string(err, test))) File "/usr/local/lib/python3.6/unittest/result.py", line 186, in _exc_info_to_string exctype, value, tb, limit=length, capture_locals=self.tb_locals) File "/usr/local/lib/python3.6/traceback.py", line 470, in __init__ exc_value.__cause__.__traceback__, AttributeError: 'getset_descriptor' object has no attribute '__traceback__'
Here is how exc_info looks like:
exc_info
(HttpError('Ignoring non-200 response',), <class 'scrapy.spidermiddlewares.httperror.HttpError'>, <traceback object at 0x7f4bdca1d948>)
The text was updated successfully, but these errors were encountered:
I've found the bug. It's inside scrapy/contracts/__init__.py.
scrapy/contracts/__init__.py
Here's how exc_info is initialized:
exc_info = failure.value, failure.type, failure.getTracebackObject()
So we get (value, type, traceback) tuple. But it must be (type, value, traceback).
(value, type, traceback)
(type, value, traceback)
I'll create a PR with a fix soon.
Sorry, something went wrong.
Merge pull request #3371 from StasDeep/fix/issue-3370
8a4e51a
[MRG+1] Fix contract errback (#3370)
No branches or pull requests
When running a contract with a URL that returns non-200 response, I get the following:
Here is how
exc_info
looks like:The text was updated successfully, but these errors were encountered: