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
d2ff243b
Kaydet (Commit)
d2ff243b
authored
Eki 17, 2014
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge: #21991: make headerregistry params property MappingProxyType.
üst
77770bda
685b3495
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
headerregistry.py
Lib/email/headerregistry.py
+2
-1
test_headerregistry.py
Lib/test/test_email/test_headerregistry.py
+3
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/email/headerregistry.py
Dosyayı görüntüle @
d2ff243b
...
...
@@ -7,6 +7,7 @@ Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.
"""
from
types
import
MappingProxyType
from
email
import
utils
from
email
import
errors
...
...
@@ -456,7 +457,7 @@ class ParameterizedMIMEHeader:
@property
def
params
(
self
):
return
self
.
_params
.
copy
(
)
return
MappingProxyType
(
self
.
_params
)
class
ContentTypeHeader
(
ParameterizedMIMEHeader
):
...
...
Lib/test/test_email/test_headerregistry.py
Dosyayı görüntüle @
d2ff243b
import
datetime
import
textwrap
import
unittest
import
types
from
email
import
errors
from
email
import
policy
from
email.message
import
Message
...
...
@@ -235,6 +236,8 @@ class TestContentTypeHeader(TestHeaderBase):
self
.
assertEqual
(
h
.
maintype
,
maintype
)
self
.
assertEqual
(
h
.
subtype
,
subtype
)
self
.
assertEqual
(
h
.
params
,
parmdict
)
with
self
.
assertRaises
(
TypeError
):
h
.
params
[
'abc'
]
=
'xyz'
# params is read-only.
self
.
assertDefectsEqual
(
h
.
defects
,
defects
)
self
.
assertEqual
(
h
,
decoded
)
self
.
assertEqual
(
h
.
fold
(
policy
=
policy
.
default
),
folded
)
...
...
Misc/NEWS
Dosyayı görüntüle @
d2ff243b
...
...
@@ -181,6 +181,10 @@ Core and Builtins
Library
-------
-
Issue
#
21991
:
Make
email
.
headerregistry
's header '
params
' attributes
be read-only (MappingProxyType). Previously the dictionary was modifiable
but a new one was created on each access of the attribute.
- Issue #22638: SSLv3 is now disabled throughout the standard library.
It can still be enabled by instantiating a SSLContext manually.
...
...
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