[Python-Dev] 2.1c1: test_zipfile fails on FreeBSD

Guido van Rossum guido@digicool.com
Sat, 14 Apr 2001 12:47:51 -0500


> FreeBSD 4.2-20010225-STABLE, gcc 2.95.2
> 
> ./python Lib/test/test_zipfile.py
> Traceback (most recent call last):
>   File "Lib/test/test_zipfile.py", line 35, in ?
>     zipTest(file, zipfile.ZIP_STORED, writtenData)
>   File "Lib/test/test_zipfile.py", line 18, in zipTest
>     zip.close()
>   File "/home/mark/src/python/CVS/python/dist/src/Lib/zipfile.py", line
> 471, in close
>     self.fp.flush()
> IOError: [Errno 9] Bad file descriptor
> 
> Looks like FreeBSD objects to doing a flush() on a file opened for
> reading. The self.fp.flush() call should probably be part of the
> preceding if-block relating to files opened in "a" or "w' mode.

You're right.  I've fixed this.

--Guido van Rossum (home page: http://www.python.org/~guido/)