Issue 14652: Better error messages for wsgiref validator failures (original) (raw)

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:29 admin set github: 58857
2015-02-13 19:23:25 berker.peksag set files: + issue14652.diffversions: + Python 3.4, Python 3.5, - Python 3.3nosy: + berker.peksagmessages: + stage: patch review
2012-05-17 14:21:00 ssm set files: + ssm_validate.patchmessages: +
2012-05-17 04:04:23 mcjeff set nosy: + mcjeffmessages: +
2012-04-23 17:48:02 ssm create