[New-bugs-announce] [issue15546] Iteration breaks with bz2.open(filename, 'rt')

David Beazley report at bugs.python.org
Fri Aug 3 11:04:34 CEST 2012

New submission from David Beazley:

The bz2 library in Python3.3b1 doesn't support iteration for text-mode properly.  Example:

>>> f = bz2.open('access-log-0108.bz2')
>>> next(f)       # Works
b' - - [24/Feb/2008:00:08:59 -0600] "GET /ply/ply.html HTTP/1.1" 200 97238\n'

>>> g = bz2.open('access-log-0108.bz2','rt')
>>> next(g)       # Fails
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

components: Library (Lib)
messages: 167299
nosy: dabeaz
priority: normal
severity: normal
status: open
title: Iteration breaks with bz2.open(filename,'rt')
type: behavior
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list