From: <pj...@us...> - 2009-05-28 05:31:57
|
Revision: 6412 http://jython.svn.sourceforge.net/jython/?rev=6412&view=rev Author: pjenvey Date: 2009-05-28 05:31:51 +0000 (Thu, 28 May 2009) Log Message: ----------- don't close external fileobjs Modified Paths: -------------- trunk/jython/Lib/tarfile.py Modified: trunk/jython/Lib/tarfile.py =================================================================== --- trunk/jython/Lib/tarfile.py 2009-05-28 04:03:31 UTC (rev 6411) +++ trunk/jython/Lib/tarfile.py 2009-05-28 05:31:51 UTC (rev 6412) @@ -1230,13 +1230,16 @@ if fileobj is not None: fileobj = _BZ2Proxy(fileobj, mode) + extfileobj = True else: fileobj = bz2.BZ2File(name, mode, compresslevel=compresslevel) + extfileobj = False try: t = cls.taropen(name, mode, fileobj) except IOError: - fileobj.close() + if not extfileobj: + fileobj.close() raise ReadError("not a bzip2 file") t._extfileobj = False return t This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |