wsgiref’s validation middleware is missing messages for many of its assertions, and its docstring doesn’t reflect read() now requiring an argument (said that it took an optional argument). Here’s a patch to add some and update the comment.
I went through the patch real quick and I noticed that your using single element tuples in your string formatting. That makes sense in situations where the argument might itself be a tuple, however, not on calls to len() as that will return an integer.
Thanks Jeff, I’m actually a relatively new Python developer and got the impression that it was best practice to always use a tuple for string formatting, for consistency. Here’s an updated patch which drops the tuples for those cases.