I have some problems in using httpx async with Multipart POST requests. I don't have the same problem with the requests backend. The problem seems to be the "merge_dict" which is only done on httpx:
File "/home/debian/run/run.py", line 261, in do_upload
logging.info(await s.post_file(other_image, ("image.swi", f, "application/octet-stream")))
File "/home/debian/run/.venv/lib/python3.9/site-packages/decorest/session.py", line 155, in invoker
return await getattr(self.__client, name)(*args, **kwargs)
File "/home/debian/run/.venv/lib/python3.9/site-packages/decorest/POST.py", line 42, in async_post_decorator
return await super(POST,
File "/home/debian/run/.venv/lib/python3.9/site-packages/decorest/decorators.py", line 206, in call_async
http_request = HttpRequest(func, self.path_template, args, kwargs)
File "/home/debian/run/.venv/lib/python3.9/site-packages/decorest/request.py", line 284, in __init__
merge_dicts(self.kwargs, self.rest_client.client_args_)
File "/home/debian/run/.venv/lib/python3.9/site-packages/decorest/utils.py", line 132, in merge_dicts
result = copy.deepcopy(dictionary)
File "/usr/lib/python3.9/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.9/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.9/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.9/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.9/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.9/copy.py", line 210, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/usr/lib/python3.9/copy.py", line 210, in <listcomp>
y = [deepcopy(a, memo) for a in x]
File "/usr/lib/python3.9/copy.py", line 161, in deepcopy
rv = reductor(4)
TypeError: cannot pickle '_io.BufferedReader' object
merge_dicts(self.kwargs, self.rest_client.client_args_)
for arg, value in self.rest_client.client_args_.items():
self.kwargs[arg]= value
it works fine.
I have some problems in using httpx async with Multipart POST requests. I don't have the same problem with the requests backend. The problem seems to be the "merge_dict" which is only done on httpx:
If I replace the :
in request.py by
it works fine.