TypeError: cannot unpack non-iterable CallbackResponse object
See original GitHub issueAfter upgrading from responses 0.12.0
to 0.12.1
our unit tests fail with the following error:
...
../../../../venv/lib/python3.8/site-packages/requests/sessions.py:590: in post
return self.request('POST', url, data=data, json=json, **kwargs)
../../../../venv/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py:515: in request
return super(OAuth2Session, self).request(
../../../../venv/lib/python3.8/site-packages/aws_xray_sdk/ext/requests/patch.py:27: in _xray_traced_requests
return xray_recorder.record_subsegment(
../../../../venv/lib/python3.8/site-packages/aws_xray_sdk/core/recorder.py:424: in record_subsegment
return_value = wrapped(*args, **kwargs)
../../../../venv/lib/python3.8/site-packages/requests/sessions.py:542: in request
resp = self.send(prep, **send_kwargs)
../../../../venv/lib/python3.8/site-packages/requests/sessions.py:655: in send
r = adapter.send(request, **kwargs)
../../../../venv/lib/python3.8/site-packages/responses.py:733: in unbound_on_send
return self._on_request(adapter, request, *a, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <responses.RequestsMock object at 0x104e06880>
adapter = <requests.adapters.HTTPAdapter object at 0x10a7a8a00>
request = <PreparedRequest [POST]>
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': 10, ...}
def _on_request(self, adapter, request, **kwargs):
> match, match_failed_reasons = self._find_match(request)
E TypeError: cannot unpack non-iterable CallbackResponse object
../../../../venv/lib/python3.8/site-packages/responses.py:680: TypeError
This seems to have been caused by the refactoring of the Response._find_match()
method.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:19 (11 by maintainers)
Top Results From Across the Web
Python: TypeError: cannot unpack non-iterable int object
The error due to variable assignment. def maxsum(arry): if len(arry)==0: return 0 summ ...
Read more >TypeError cannot unpack non-iterable NoneType object
The “TypeError: cannot unpack non-iterable NoneType object” error is raised when you try to unpack values from one that is equal to None....
Read more >Typeerror: cannot unpack non-iterable nonetype object
During the process of unpacking items in iterable objects, you may get an error that says: "TypeError: cannot unpack non-iterable NoneType ...
Read more >TypeError: cannot unpack non-iterable NoneType object
The Python TypeError: cannot unpack non-iterable NoneType object error is raised when you try to unpack a None value. On Career Karma, learn ......
Read more >Why am I getting an 'TypeError: cannot unpack non-iterable int ...
When you use the for i,j in item syntax, Python is expecting that item is an iterable of iterables, which can be unpacked...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hramezani I’ve also tried to create a minimal example for you. It passes on my machine when I use responses version 0.12.0 and fails when I upgrade to 0.12.1:
I created a PR(https://github.com/getsentry/responses/pull/359) to address this problem.