mirror of https://github.com/python/cpython
Issue #4750: Store the basename of the original filename in
the gzip FNAME header as required by RFC 1952.
This commit is contained in:
parent
ea0e3b0d60
commit
8c06ccc058
|
@ -5,7 +5,7 @@ but random access is not allowed."""
|
||||||
|
|
||||||
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
|
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
|
||||||
|
|
||||||
import struct, sys, time
|
import struct, sys, time, os
|
||||||
import zlib
|
import zlib
|
||||||
import __builtin__
|
import __builtin__
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ class GzipFile:
|
||||||
def _write_gzip_header(self):
|
def _write_gzip_header(self):
|
||||||
self.fileobj.write('\037\213') # magic header
|
self.fileobj.write('\037\213') # magic header
|
||||||
self.fileobj.write('\010') # compression method
|
self.fileobj.write('\010') # compression method
|
||||||
fname = self.name
|
fname = os.path.basename(self.name)
|
||||||
if fname.endswith(".gz"):
|
if fname.endswith(".gz"):
|
||||||
fname = fname[:-3]
|
fname = fname[:-3]
|
||||||
flags = 0
|
flags = 0
|
||||||
|
|
|
@ -427,6 +427,9 @@ Core and Builtins
|
||||||
Library
|
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
|
- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
|
||||||
Distutils.
|
Distutils.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue