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.

Author mark.dickinson
Recipients mark.dickinson, pitrou
Date 2010-05-04.18:18:03
SpamBayes Score 5.2705345e-06
Marked as misclassified No
Message-id <1272997084.97.0.485599300068.issue8614@psf.upfronthosting.co.za>
In-reply-to
Content
test_buffered_reader test_gzip is failing for me since r80720, on trunk on OS X 10.6.3:

======================================================================
ERROR: test_buffered_reader (__main__.TestGzip)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_gzip.py", line 91, in test_buffered_reader
    lines = [line for line in r]
  File "/Users/dickinsm/python/svn/trunk/Lib/gzip.py", line 365, in flush
    self.fileobj.flush()
IOError: [Errno 9] Bad file descriptor

----------------------------------------------------------------------
Ran 16 tests in 1.258s

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_gzip.py", line 271, in <module>
    test_main(verbose=True)
  File "Lib/test/test_gzip.py", line 268, in test_main
    test_support.run_unittest(TestGzip)
  File "/Users/dickinsm/python/svn/trunk/Lib/test/test_support.py", line 1038, in run_unittest
    _run_suite(suite)
  File "/Users/dickinsm/python/svn/trunk/Lib/test/test_support.py", line 1021, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_gzip.py", line 91, in test_buffered_reader
    lines = [line for line in r]
  File "/Users/dickinsm/python/svn/trunk/Lib/gzip.py", line 365, in flush
    self.fileobj.flush()
IOError: [Errno 9] Bad file descriptor


Here's a minimal Python script that produces the failure:

import gzip
import io

f = gzip.GzipFile('hamster', 'wb')
f.write("some data")
f.close()

f = gzip.GzipFile('hamster', 'rb')
r = io.BufferedReader(f)
lines = [line for line in r]
r.close()

This gives the following output:

Traceback (most recent call last):
  File "test_gzip.py", line 11, in <module>
    r.close()
  File "/Users/dickinsm/python/svn/trunk/Lib/gzip.py", line 365, in flush
    self.fileobj.flush()
IOError: [Errno 9] Bad file descriptor
[20213 refs]
History
Date User Action Args
2010-05-04 18:18:05mark.dickinsonsetrecipients: + mark.dickinson, pitrou
2010-05-04 18:18:04mark.dickinsonsetmessageid: <1272997084.97.0.485599300068.issue8614@psf.upfronthosting.co.za>
2010-05-04 18:18:03mark.dickinsonlinkissue8614 messages
2010-05-04 18:18:03mark.dickinsoncreate