[New-bugs-announce] [issue3834] wsgiref.validator.InputWrapper readline method has wrong signature

Christopher Arndt report at bugs.python.org
Thu Sep 11 14:22:25 CEST 2008


New submission from Christopher Arndt <chris at chrisarndt.de>:

The readline method in the InputWrapper class in wsgiref.validate does
not  accept any arguments and therefore is not compatible with the
"file-like" interface, where the readline method accepts an optional
"size" argument. 

This breaks code that wraps file objects with their own wrapper class
and tries to call the readline method of the wrapped object with a
"size" argument.

Current code::

    def readline(self):
        v = self.input.readline()
        assert_(type(v) is type(""))
        return v


Should be::

    def readline(self, *args):
        v = self.input.readline(*args)
        assert_(type(v) is type(""))
        return v

----------
components: Library (Lib)
messages: 73016
nosy: strogon14
severity: normal
status: open
title: wsgiref.validator.InputWrapper readline method has wrong signature
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3834>
_______________________________________


More information about the New-bugs-announce mailing list