# based on Andrew Kuchling's minigzip.py distributed with the zlib module
-import struct, sys, time
+import struct, sys, time, os
import zlib
import builtins
try:
# RFC 1952 requires the FNAME field to be Latin-1. Do not
# include filenames that cannot be represented that way.
- fname = self.name.encode('latin-1')
+ fname = os.path.basename(self.name)
+ fname = fname.encode('latin-1')
if fname.endswith(b'.gz'):
fname = fname[:-3]
except UnicodeEncodeError:
Library
-------
+- Issue #4750: Store the basename of the original filename in the gzip FNAME
+ header as required by RFC 1952.
+
- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
Distutils.