This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Better error messages for wsgiref validator failures
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, mcjeff, ssm
Priority: normal Keywords: patch

Created on 2012-04-23 17:48 by ssm, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
ssm_validate.patch ssm, 2012-04-23 17:48 review
ssm_validate.patch ssm, 2012-05-17 14:21 Don’t use tuples when using only len() to format a string review
issue14652.diff berker.peksag, 2015-02-13 19:23 review
Messages (4)
msg159053 - (view) Author: Sidney San Martín (ssm) * Date: 2012-04-23 17:48
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.
msg160951 - (view) Author: Jeff McNeil (mcjeff) * Date: 2012-05-17 04:04
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.
msg160971 - (view) Author: Sidney San Martín (ssm) * Date: 2012-05-17 14:21
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.
msg235914 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-13 19:23
Here is an updated patch. For InputWrapper.read(), see issue 18610.
History
Date User Action Args
2022-04-11 14:57:29adminsetgithub: 58857
2015-02-13 19:23:25berker.peksagsetfiles: + issue14652.diff
versions: + Python 3.4, Python 3.5, - Python 3.3
nosy: + berker.peksag

messages: + msg235914

stage: patch review
2012-05-17 14:21:00ssmsetfiles: + ssm_validate.patch

messages: + msg160971
2012-05-17 04:04:23mcjeffsetnosy: + mcjeff
messages: + msg160951
2012-04-23 17:48:02ssmcreate