Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
04b9403e
Kaydet (Commit)
04b9403e
authored
Nis 06, 2006
tarafından
Anthony Baxter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix for failure of test_urllib2 breaking test_mimetypes (SF bug 1464978)
will backport.
üst
e94e3b44
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
mimetypes.py
Lib/mimetypes.py
+20
-11
test_mimetypes.py
Lib/test/test_mimetypes.py
+1
-0
No files found.
Lib/mimetypes.py
Dosyayı görüntüle @
04b9403e
...
...
@@ -315,23 +315,29 @@ def read_mime_types(file):
return
db
.
types_map
[
True
]
suffix_map
=
{
def
_default_mime_types
():
global
suffix_map
global
encodings_map
global
types_map
global
common_types
suffix_map
=
{
'.tgz'
:
'.tar.gz'
,
'.taz'
:
'.tar.gz'
,
'.tz'
:
'.tar.gz'
,
}
encodings_map
=
{
encodings_map
=
{
'.gz'
:
'gzip'
,
'.Z'
:
'compress'
,
}
# Before adding new types, make sure they are either registered with IANA, at
#
http://www.isi.edu/in-notes/iana/assignments/media-types
# or extensions, i.e. using the x- prefix
# Before adding new types, make sure they are either registered with IANA,
# at
http://www.isi.edu/in-notes/iana/assignments/media-types
# or extensions, i.e. using the x- prefix
# If you add to these, please keep them sorted!
types_map
=
{
# If you add to these, please keep them sorted!
types_map
=
{
'.a'
:
'application/octet-stream'
,
'.ai'
:
'application/postscript'
,
'.aif'
:
'audio/x-aiff'
,
...
...
@@ -457,11 +463,11 @@ types_map = {
'.zip'
:
'application/zip'
,
}
# These are non-standard types, commonly found in the wild. They will only
#
match if strict=0 flag is given to the API methods.
# These are non-standard types, commonly found in the wild. They will
# only
match if strict=0 flag is given to the API methods.
# Please sort these too
common_types
=
{
# Please sort these too
common_types
=
{
'.jpg'
:
'image/jpg'
,
'.mid'
:
'audio/midi'
,
'.midi'
:
'audio/midi'
,
...
...
@@ -473,6 +479,9 @@ common_types = {
}
_default_mime_types
()
if
__name__
==
'__main__'
:
import
sys
import
getopt
...
...
Lib/test/test_mimetypes.py
Dosyayı görüntüle @
04b9403e
...
...
@@ -8,6 +8,7 @@ from test import test_support
# Tell it we don't know about external files:
mimetypes
.
knownfiles
=
[]
mimetypes
.
inited
=
False
mimetypes
.
_default_mime_types
()
class
MimeTypesTestCase
(
unittest
.
TestCase
):
...
...
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