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: wsgiref.validate.InputWrapper.readline does not accept optional "length" argument
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: pje Nosy List: pje, xaka
Priority: normal Keywords:

Created on 2008-07-25 11:38 by xaka, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg70248 - (view) Author: Pavel Strashkin (xaka) Date: 2008-07-25 11:38
All file/stream-like objects in Python have "readline" method with
optional "length" argument, but wsgiref.validate.InputWrapper doest not
have. Some 3rd party modules/packages use this argument. As result there
is exception:
<type 'exceptions.TypeError'>: readline() takes exactly 1 argument (2 given)

I think wsgiref.validate.InputWrapper.readline must be implemented same
to wsgiref.validate.InputWrapper.read:

def readline(self, *args, **kwargs):
    v = self.input.readline(*args, **kwargs)
    assert_(type(v) is type(""))
    return v
msg70255 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2008-07-25 14:54
Any package which is using the length argument to readline() is in
violation of PEP 333 and should be fixed.  The argument is intentionally
not supported by wsgiref.validate, since its purpose is to catch
incorrect programs that are violating the spec by using it.
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47692
2008-07-25 14:54:48pjesetstatus: open -> closed
resolution: not a bug
messages: + msg70255
2008-07-25 12:53:39benjamin.petersonsetassignee: pje
nosy: + pje
2008-07-25 11:38:06xakacreate