[issue1986] io.StringIO allows any parameter

Rafael Zanella report at bugs.python.org
Sun Feb 24 23:02:30 CET 2008

Rafael Zanella added the comment:

oops, stupid me, this a 3.0 issue..., well seems the str() conversion is
done as well on the 3.0 io module:

class StringIO(TextIOWrapper):
   def __init__(self, initial_value="", encoding="utf-8",
                 errors="strict", newline="\n"):
        super(StringIO, self).__init__(BytesIO(),
        if initial_value:
            if not isinstance(initial_value, str):
                initial_value = str(initial_value)

Tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list