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.

Author alexandre.vassalotti
Recipients alexandre.vassalotti
Date 2009-06-08.19:46:59
SpamBayes Score 3.826084e-11
Marked as misclassified No
Message-id <1244490422.03.0.396715163252.issue6241@psf.upfronthosting.co.za>
In-reply-to
Content
The included patch makes type checking of the arguments of StringIO
consistent between pyio and io.

>>> import io
>>> io.StringIO(b"hello")
Traceback (most recent call last):
  ...
ValueError: initial_value must be str or None, not bytes
>>> io.StringIO(newline=b"\n")
<_io.StringIO object at 0x7f93d52953d0>
>>> import _pyio as pyio
>>> pyio.StringIO(newline=b"\n")
Traceback (most recent call last):
  ...
TypeError: illegal newline type: <class 'bytes'>

>>> io.StringIO([])
Traceback (most recent call last):
  ...
ValueError: initial_value must be str or None, not list
>>> pyio.StringIO([])
<_pyio.StringIO object at 0x7f93d4942610>
History
Date User Action Args
2009-06-08 19:47:02alexandre.vassalottisetrecipients: + alexandre.vassalotti
2009-06-08 19:47:02alexandre.vassalottisetmessageid: <1244490422.03.0.396715163252.issue6241@psf.upfronthosting.co.za>
2009-06-08 19:47:00alexandre.vassalottilinkissue6241 messages
2009-06-08 19:47:00alexandre.vassalotticreate