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.

Title: Convert str to bytes in io.BytesIO.__init__
Type: Stage:
Components: Library (Lib) Versions: Python 3.0
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: alexandre.vassalotti
Priority: normal Keywords: patch

Created on 2007-08-15 16:23 by alexandre.vassalotti, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
convert_str_to_bytes.patch alexandre.vassalotti, 2007-08-15 16:23
Messages (2)
msg53036 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2007-08-15 16:23
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/", line 592, in __init__
      buffer += initial_bytes
  TypeError: can't concat bytes to str
msg53037 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2007-08-21 18:32
Committed in r57263 in the alex-py3k branch, along with other fixes.

Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45315
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: + Python 3.0
2007-08-15 16:23:55alexandre.vassalotticreate