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
6aca7652
Commit
6aca7652
authored
May 04, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions.
parent
0801d73b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
Lib/mimetypes.py
Lib/mimetypes.py
+2
-0
Lib/test/test_mimetypes.py
Lib/test/test_mimetypes.py
+2
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/mimetypes.py
View file @
6aca7652
...
...
@@ -386,12 +386,14 @@ def _default_mime_types():
'.taz'
:
'.tar.gz'
,
'.tz'
:
'.tar.gz'
,
'.tbz2'
:
'.tar.bz2'
,
'.txz'
:
'.tar.xz'
,
}
encodings_map
=
{
'.gz'
:
'gzip'
,
'.Z'
:
'compress'
,
'.bz2'
:
'bzip2'
,
'.xz'
:
'xz'
,
}
# Before adding new types, make sure they are either registered with IANA,
...
...
Lib/test/test_mimetypes.py
View file @
6aca7652
...
...
@@ -21,6 +21,8 @@ class MimeTypesTestCase(unittest.TestCase):
eq
(
self
.
db
.
guess_type
(
"foo.tgz"
),
(
"application/x-tar"
,
"gzip"
))
eq
(
self
.
db
.
guess_type
(
"foo.tar.gz"
),
(
"application/x-tar"
,
"gzip"
))
eq
(
self
.
db
.
guess_type
(
"foo.tar.Z"
),
(
"application/x-tar"
,
"compress"
))
eq
(
self
.
db
.
guess_type
(
"foo.tar.bz2"
),
(
"application/x-tar"
,
"bzip2"
))
eq
(
self
.
db
.
guess_type
(
"foo.tar.xz"
),
(
"application/x-tar"
,
"xz"
))
def
test_data_urls
(
self
):
eq
=
self
.
assertEqual
...
...
Misc/NEWS
View file @
6aca7652
...
...
@@ -34,6 +34,8 @@ Core and Builtins
Library
-------
-
Issue
#
16316
:
mimetypes
now
recognizes
the
.
xz
and
.
txz
(.
tar
.
xz
)
extensions
.
-
Issue
#
17192
:
Restore
the
patch
for
Issue
#
10309
which
was
ommitted
in
2.7.4
when
updating
the
bundled
version
of
libffi
used
by
ctypes
.
...
...
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