Commit 1440df2f authored by Lars Gustäbel's avatar Lars Gustäbel

Merged revisions 75935 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75935 | lars.gustaebel | 2009-10-29 10:15:00 +0100 (Thu, 29 Oct 2009) | 3 lines

  Issue #4750: Store the basename of the original filename in
  the gzip FNAME header as required by RFC 1952.
........
parent 2ee28c90
...@@ -5,7 +5,7 @@ but random access is not allowed.""" ...@@ -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 builtins import builtins
...@@ -158,7 +158,8 @@ class GzipFile: ...@@ -158,7 +158,8 @@ class GzipFile:
try: try:
# RFC 1952 requires the FNAME field to be Latin-1. Do not # RFC 1952 requires the FNAME field to be Latin-1. Do not
# include filenames that cannot be represented that way. # 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'): if fname.endswith(b'.gz'):
fname = fname[:-3] fname = fname[:-3]
except UnicodeEncodeError: except UnicodeEncodeError:
......
...@@ -120,6 +120,9 @@ C-API ...@@ -120,6 +120,9 @@ C-API
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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment