Changelog¶
21.1.0 (2021-01-14)¶
Features¶
- Support for Python 3.9: treq is now tested with CPython 3.9. (#305)
- The auth parameter now accepts arbitrary text and
bytes
for usernames and passwords. Text is encoded as UTF-8, per RFC 7617. Previously only ASCII was allowed. (#268) - treq produces a more helpful exception when passed a tuple of the wrong size in the files parameter. (#299)
Bugfixes¶
- The params argument once more accepts non-ASCII
bytes
, fixing a regression first introduced in treq 20.4.1. (#303) - treq request APIs no longer mutates a
http_headers.Headers
passed as the headers parameter when the auth parameter is also passed. (#314) - The agent returned by
treq.auth.add_auth()
andtreq.auth.add_basic_auth()
is now marked to providetwisted.web.iweb.IAgent
. (#312) - treq’s package metadata has been updated to require
six >= 1.13
, noting a dependency introduced in treq 20.9.0. (#295)
Improved Documentation¶
Deprecations and Removals¶
- Support for Python 2.7, which has reached end of support, is deprecated. This is the last release with support for Python 2.7. (#309)
- Support for Python 3.5, which has reached end of support, is deprecated. This is the last release with support for Python 3.5. (#306)
- Deprecate tolerance of non-string values when passing headers as a dict. They have historically been silently dropped, but will raise TypeError in the next treq release. Also deprecate passing headers other than
dict
,Headers
, orNone
. Historically falsy values like[]
or()
were accepted. (#294) - treq request functions and methods like
treq.get()
andHTTPClient.post()
now issue aDeprecationWarning
when passed unknown keyword arguments, rather than ignoring them. Mixing the json argument with files or data is also deprecated. These warnings will change to aTypeError
in the next treq release. (#297) - The minimum supported Twisted version has increased to 18.7.0. Older versions are no longer tested in CI. (#307)
20.9.0 (2020-09-27)¶
Features¶
- The url parameter of
HTTPClient.request()
(and shortcuts likeget()
) now accepthyperlink.DecodedURL
andhyperlink.URL
in addition tostr
andbytes
. (#212) - Compatibility with the upcoming Twisted 20.9.0 release (#290).
20.4.1 (2020-04-16)¶
Bugfixes¶
- Correct a typo in the treq 20.4.0 package metadata that prevented upload to PyPI (pypa/twine#589)
20.4.0 (2020-04-16)¶
Bugfixes¶
treq.client.HTTPClient.request()
and its aliases no longer raiseUnicodeEncodeError
when passed a Unicode url and non-empty params. Now the URL and query parameters are concatenated as documented. (#264)- In treq 20.3.0 the params argument didn’t accept parameter names or values that contain the characters
&
or#
. Now these characters are properly escaped. (#282)
Improved Documentation¶
- The treq documentation has been revised to emphasize use of
treq.client.HTTPClient
over the module-level convenience functions in thetreq
module. (#276)
20.3.0 (2020-03-15)¶
Bugfixes¶
treq.testing.RequestTraversalAgent
now passes its memory reactor to thetwisted.web.server.Site
it creates, preventing theSite
from polluting the global reactor. (#225)treq.testing
no longer generates deprecation warnings abouttwisted.test.proto_helpers.MemoryReactor
. (#253)
Improved Documentation¶
- The
download_file.py
example has been updated to do a streaming download with unbuffered=True. (#233) - The agent parameter to
treq.request()
has been documented. (#235) - The type of the headers element of a response tuple passed to
treq.testing.RequestSequence
is now correctly documented asstr
. (#237)