Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0d110d9d
Commit
0d110d9d
authored
Feb 13, 2007
by
Lars Gustäbel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip the '.gz' extension from the filename that is written to the
gzip header.
parent
4945b258
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Lib/gzip.py
Lib/gzip.py
+6
-3
No files found.
Lib/gzip.py
View file @
0d110d9d
...
...
@@ -149,15 +149,18 @@ class GzipFile:
def
_write_gzip_header
(
self
):
self
.
fileobj
.
write
(
'
\
037
\
213
'
)
# magic header
self
.
fileobj
.
write
(
'
\
010
'
)
# compression method
fname
=
self
.
name
if
fname
.
endswith
(
".gz"
):
fname
=
fname
[:
-
3
]
flags
=
0
if
self
.
name
:
if
f
name
:
flags
=
FNAME
self
.
fileobj
.
write
(
chr
(
flags
))
write32u
(
self
.
fileobj
,
long
(
time
.
time
()))
self
.
fileobj
.
write
(
'
\
002
'
)
self
.
fileobj
.
write
(
'
\
377
'
)
if
self
.
name
:
self
.
fileobj
.
write
(
self
.
name
+
'
\
000
'
)
if
f
name
:
self
.
fileobj
.
write
(
f
name
+
'
\
000
'
)
def
_init_read
(
self
):
self
.
crc
=
zlib
.
crc32
(
""
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment