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.

classification
Title: Consider allowing io.BytesIO sizes to be passed as 'long' in 2.6
Type: behavior Stage: needs patch
Components: IO, Library (Lib) Versions: Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pitrou Nosy List: pitrou, ryles
Priority: normal Keywords:

Created on 2009-11-02 03:50 by ryles, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg94818 - (view) Author: Ryan Leslie (ryles) Date: 2009-11-02 03:50
py> StringIO.StringIO("foo").read(long(1))
'f'

py> io.BytesIO("foo").read(long(1))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: integer argument expected, got 'long'

This is known to cause problems when reading zip data from a BytesIO
object with zipfile. See this recent thread on comp.lang.python:

http://groups.google.com/group/comp.lang.python/browse_thread/thread/337c1b8a48e8acae/
msg94845 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-11-02 21:05
I've committed to the 2.6 branch in r76073. 2.7 is actually ok.
Thanks for the report!
History
Date User Action Args
2022-04-11 14:56:54adminsetgithub: 51498
2009-11-02 21:05:08pitrousetstatus: open -> closed
resolution: fixed
messages: + msg94845
2009-11-02 19:19:08pitrousetpriority: normal
nosy: pitrou, ryles
versions: + Python 2.7
components: + IO
stage: needs patch
2009-11-02 18:20:25georg.brandlsetassignee: pitrou

nosy: + pitrou
2009-11-02 03:50:43rylescreate