Open f80b24cc-32aa-43d3-b7a7-c241e07eb45f opened 12 years ago
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.
Here is an updated patch. For InputWrapper.read(), see bpo-18610.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at = None created_at =
labels = ['type-feature', 'library']
title = 'Better error messages for wsgiref validator failures'
updated_at =
user = 'https://github.com/Sidnicious'
```
bugs.python.org fields:
```python
activity =
actor = 'berker.peksag'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation =
creator = 'ssm'
dependencies = []
files = ['25320', '25624', '38131']
hgrepos = []
issue_num = 14652
keywords = ['patch']
message_count = 4.0
messages = ['159053', '160951', '160971', '235914']
nosy_count = 3.0
nosy_names = ['mcjeff', 'berker.peksag', 'ssm']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue14652'
versions = ['Python 3.4', 'Python 3.5']
```