You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a TypeError: cannot pickle 'generator' object error when using urllib3 v2.1.0 and the error goes away with urllib3 v1.26.18. The vcrpy version is 5.1.0; Python v3.10.13.
The stack trace leads to before_record_request in vcr/config.py. I probably won't be able to provide a good reproducible example right now, but I thought it might be helpful to leave some breadcrumbs for a future investigation:
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/site-packages/requests/adapters.py:486: in send
resp = conn.urlopen(
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/site-packages/urllib3/connectionpool.py:790: in urlopen
response = self._make_request(
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/site-packages/urllib3/connectionpool.py:536: in _make_request
response = conn.getresponse()
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/site-packages/vcr/stubs/__init__.py:257: in getresponse
if self.cassette.can_play_response_for(self._vcr_request):
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/site-packages/vcr/cassette.py:263: in can_play_response_for
request = self._before_record_request(request)
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/site-packages/vcr/config.py:223: in before_record_request
request = copy.deepcopy(request)
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/copy.py:172: in deepcopy
y = _reconstruct(x, memo, *rv)
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/copy.py:271: in _reconstruct
state = deepcopy(state, memo)
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/copy.py:146: in deepcopy
y = copier(x, memo)
/home/acme-corp/.conda/envs/apa-proxy/lib/python3.10/copy.py:231: in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
x = <generator object Client.upload_data.<locals>.json_stream at 0x7f792ac86030>
memo = {140158380145104: <[AttributeError("'Request' object has no attribute 'method'") raised in repr()] Request object at 0...', 'uri': 'http://localhost:8080/websrv/portfolios/test_cancel_task/dates?enforce-partial-import=false'}}
_nil = []
def deepcopy(x, memo=None, _nil=[]):
"""Deep copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
"""
if memo is None:
memo = {}
d = id(x)
y = memo.get(d, _nil)
if y is not _nil:
return y
cls = type(x)
copier = _deepcopy_dispatch.get(cls)
if copier is not None:
y = copier(x, memo)
else:
if issubclass(cls, type):
y = _deepcopy_atomic(x, memo)
else:
copier = getattr(x, "__deepcopy__", None)
if copier is not None:
y = copier(memo)
else:
reductor = dispatch_table.get(cls)
if reductor:
rv = reductor(x)
else:
reductor = getattr(x, "__reduce_ex__", None)
if reductor is not None:
> rv = reductor(4)
E TypeError: cannot pickle 'generator' object
The text was updated successfully, but these errors were encountered:
I get a
TypeError: cannot pickle 'generator' object
error when using urllib3 v2.1.0 and the error goes away with urllib3 v1.26.18. The vcrpy version is 5.1.0; Python v3.10.13.The stack trace leads to before_record_request in vcr/config.py. I probably won't be able to provide a good reproducible example right now, but I thought it might be helpful to leave some breadcrumbs for a future investigation:
The text was updated successfully, but these errors were encountered: