[issue8397] BZ2File doesn't protect against mixed iterator and read usage

2010-08-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Fixed in r83440 (py3k), r83441 (3.1), r83442 (2.7), r83443 (2.6). -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker _

[issue8397] BZ2File doesn't protect against mixed iterator and read usage

2010-08-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch for py3k. -- keywords: +patch nosy: +georg.brandl Added file: http://bugs.python.org/file18315/bziter.patch ___ Python tracker _

[issue8397] BZ2File doesn't protect against mixed iterator and read usage

2010-08-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well I'm not the bz2 maintainer but I could take a look. The BZ2File implementation is generally a straight ripoff of the 2.x file object, with (de)compression calls added where necessary. I guess the ripoff was a one-shot effort and subsequent maintenance wa

[issue8397] BZ2File doesn't protect against mixed iterator and read usage

2010-08-01 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> pitrou nosy: +pitrou priority: normal -> high versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5 ___ Python tracker ___ _

[issue8397] BZ2File doesn't protect against mixed iterator and read usage

2010-04-14 Thread Alex Stapleton
New submission from Alex Stapleton : Normal files throw exceptions if you mix methods. >>> f = open("words") >>> for l in f: ... break ... >>> f.tell() 8192L >>> f.readline() Traceback (most recent call last): File "", line 1, in ValueError: Mixing iteration and read methods would lose d