[ python-Patches-1774833 ] Convert str to bytes in io.BytesIO.__init__
"SourceForge.net" <[email protected]> Wed, 15 Aug 2007 09:23:55 -0700
| Newsgroups | gmane.comp.python.patches |
|---|---|
| Message-ID | <[email protected]> |
Patches item #1774833, was opened at 2007-08-15 12:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1774833&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alexandre Vassalotti (avassalotti)
Assigned to: Nobody/Anonymous (nobody)
Summary: Convert str to bytes in io.BytesIO.__init__
Initial Comment:
This patch allows a str object to be used as the initial value of io.BytesIO:
>>> x = io.BytesIO('1234')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alex/src/python.org/py3k/Lib/io.py", line 592, in __init__
buffer += initial_bytes
TypeError: can't concat bytes to str
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1774833&group_id=5470