[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed in r85291 (3.x), and backported to 3.1 (r85293) and 2.7 (r85292). Thank you! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-15 Thread Jeffrey Finkelstein
Jeffrey Finkelstein added the comment: Here's the updated patch, which checks whether the file is closed on each call to read(), write(), and flush(), along with a test. -- Added file: http://bugs.python.org/file18893/issue9759.patch ___ Python trac

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: You should make sure that all operations (except close() itself) raise ValueError. Currently: >>> f = gzip.open("test.gz", "rb") >>> f.close() >>> f.read() b'' >>> f.seek(0) 0 Also, you don't have to post a patch for 2.7. We'll do the porting ourselves. Thank

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-13 Thread Jeffrey Finkelstein
Jeffrey Finkelstein added the comment: Here's the 2.7 branch patch. -- Added file: http://bugs.python.org/file18875/issue9759.patch ___ Python tracker ___ ___

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-13 Thread Jeffrey Finkelstein
Jeffrey Finkelstein added the comment: Here is a patch for the py3k branch which adds a check for whether the GzipFile is closed on each call to GzipFile.read(). If the file is closed already, the method raises a ValueError if it is (with the message text copied from the corresponding fileobj

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 2.7, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-11 Thread Éric Araujo
Éric Araujo added the comment: Should this be fixed in 3.1 and 2.7 too? -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-l

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-07 Thread R. David Murray
Changes by R. David Murray : -- keywords: +easy nosy: +pitrou versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-03 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-03 Thread Alain Kalker
New submission from Alain Kalker : >>> f = open("test2.gz") >>> d = f.read() >>> f.close() >>> e = f.read() Traceback (most recent call last): File "", line 1, in ValueError: I/O operation on closed file import gzip >>> f = gzip.open("test2.gz") >>> d = f.read() >>> f.close() >>> e = f.read()