Closed twm closed 3 years ago
If passed a tuple with a length other than 2 or 3 IBodyProducer would end up trying to adapt None, producing this confusing message:
IBodyProducer
None
Traceback (most recent call last): File ".../treq/test/test_client.py", line 513, in test_request_files_bad_tuples self.client.request( File ".../treq/client.py", line 190, in request bodyProducer, contentType = self._request_body( File ".../treq/client.py", line 297, in _request_body files = list(_convert_files(files, stacklevel=stacklevel + 2)) File ".../treq/client.py", line 388, in _convert_files yield (param, (file_name, content_type, IBodyProducer(fobj))) builtins.TypeError: ('Could not adapt', None, <InterfaceClass twisted.web.iweb.IBodyProducer>)
This changeset produces a TypeError that mentions tuple length.
TypeError
Thank you for the review @adiroiban!
If passed a tuple with a length other than 2 or 3
IBodyProducer
would end up trying to adaptNone
, producing this confusing message:This changeset produces a
TypeError
that mentions tuple length.