Age | Commit message (Collapse) | Author |
|
In order to use type hint syntax, we need to bump the minimum Python
version to 3.7 and some of the features such as Literal and Protocol are
opted in when a sufficiently recent Python is available.
This does not make all of the code pass type checking with mypy. A
number of typing issues remain, but the output of mypy becomes something
one can read through.
In adding type hints, a lot of epydoc @type annotations are removed as
redundant. This update also adopts black-style line breaking.
|
|
|
|
|
|
There is no reason to use old-style classes beyond laziness.
|
|
There is no file builtin, and binary mode gives bytes instead of str.
|
|
* applications returned errors as str instead of bytes
* filters documentation updated with bytes
* various filters expecting str where bytes are passed
* escape_string also needs to use bytes.isalnum instead of str.isalnum
* middlewares injecting str where bytes are expected
|
|
Convert the request body data from str to bytes. This replaces all
StringIOs with BytesIOs (removing backwards one more backwards
compatibility). Also all character sequences involved in request bodies
get a b"" prefix. The StaticContent application takes bytes instead of
str (no difference for py2x). The GzipWSGIFilter needs a fixed as a
truncate of a BytesIO does not rewind the stream position.
|
|
PEP333 says that the headers list passed to start_response may be modified by
servers or middlewares. In fact this happens in DigestAuthMiddleware. The
StaticContent and CachingMiddleware classes did not take this into account and
returned the same headers list multiple times which is wrong and can lead to
denial of service.
|
|
It gained the capability to server content to unknown methods. For a
backwards-compatible API this has to be enabled by an optional boolean.
|
|
These changes introduce some compatibility code. They don't make
wsgitools usable with Python 3.0, but they also don't break
compatibility with Python 2.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|