Issue 3442: wsgiref.validate.InputWrapper.readline does not accept optional "length" argument (original) (raw)

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