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

Incompatible with inline_requests #10

Open
wRAR opened this issue Apr 22, 2019 · 2 comments
Open

Incompatible with inline_requests #10

wRAR opened this issue Apr 22, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@wRAR
Copy link
Member

wRAR commented Apr 22, 2019

If a callback method is decorated with inline_requests the middleware fails to process it:

  File ".venv/lib/python3.7/site-packages/scrapy_autounit/middleware.py", line 62, in process_spider_output
    'data': parse_object(elem, spider, self.settings)
  File ".venv/lib/python3.7/site-packages/scrapy_autounit/utils.py", line 106, in parse_object
    return parse_request(_object, spider, settings)
  File ".venv/lib/python3.7/site-packages/scrapy_autounit/utils.py", line 116, in parse_request
    _request = request_to_dict(request, spider=spider)
  File ".venv/lib/python3.7/site-packages/scrapy/utils/reqser.py", line 19, in request_to_dict
    cb = _find_method(spider, cb)
  File ".venv/lib/python3.7/site-packages/scrapy/utils/reqser.py", line 79, in _find_method
    raise ValueError("Function %s is not a method of: %s" % (func, obj))
ValueError: Function functools.partial(<bound method RequestGenerator._handleSuccess of <inline_requests.generator.RequestGenerator object at 0x7f2eb90f20b8>>, generator=<generator object CheapesteesSpider.parse_product at 0x7f2e93ddc390>) is not a method of: <FooSpider 'foo' at 0x7f2eb9e19c18>
@fcanobrash
Copy link
Collaborator

Hi Andrey, we'll take a look at this to support inline requests. Thanks for your feedback.

@fcanobrash
Copy link
Collaborator

Reviewing the issue again, support for inline_requests is not that easy to implement.
Won't integrate this in the short term but let's keep the issue open to re-evaluate it in the future.

@fcanobrash fcanobrash added the enhancement New feature or request label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants