[issue1986] io.StringIO allows any parameter

2008-02-25 Thread Georg Brandl
Georg Brandl added the comment: Okay, then I see this as a intended feature. -- resolution: -> wont fix status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ __

[issue1986] io.StringIO allows any parameter

2008-02-25 Thread Benjamin Peterson
Benjamin Peterson added the comment: According to the docs: "When a StringIO object is created, it can be initialized to an existing string by passing the string to the constructor." So, it seems that that the docs are being too strict, or the code is being too open. The conversion to str in the

[issue1986] io.StringIO allows any parameter

2008-02-24 Thread Christian Heimes
Christian Heimes added the comment: In Python 2.x StringIO.StringIO calls str() on its arguments: >>> StringIO.StringIO(1).read() '1' >>> StringIO.StringIO(object).read() "" >>> str(object) "" io.StringIO has the same behavior: >>> io.StringIO(1).read() '1' >>> io.StringIO(object).read() "" Ge

[issue1986] io.StringIO allows any parameter

2008-02-24 Thread Rafael Zanella
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"): supe

[issue1986] io.StringIO allows any parameter

2008-02-24 Thread Rafael Zanella
Rafael Zanella added the comment: I believe you're referring to StringIO, if so, it changes the parameter received to a string: """ class StringIO: def __init__(self, buf = ''): # Force self.buf to be a string or unicode if not isinstance(buf, basestring): buf = str

[issue1986] io.StringIO allows any parameter

2008-02-01 Thread Georg Brandl
New submission from Georg Brandl: >>> x = io.StringIO(1) >>> x.read() '1' -- components: Extension Modules messages: 61957 nosy: georg.brandl priority: high severity: normal status: open title: io.StringIO allows any parameter type: behavior versions: Python 3.0