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
c489e834
Kaydet (Commit)
c489e834
authored
Şub 07, 2014
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge: #17369: Improve handling of broken RFC2231 values in get_filename.
üst
f1e95336
1e949890
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
utils.py
Lib/email/utils.py
+4
-0
test_email.py
Lib/test/test_email/test_email.py
+20
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/email/utils.py
Dosyayı görüntüle @
c489e834
...
@@ -347,6 +347,10 @@ def collapse_rfc2231_value(value, errors='replace',
...
@@ -347,6 +347,10 @@ def collapse_rfc2231_value(value, errors='replace',
# object. We do not want bytes() normal utf-8 decoder, we want a straight
# object. We do not want bytes() normal utf-8 decoder, we want a straight
# interpretation of the string as character bytes.
# interpretation of the string as character bytes.
charset
,
language
,
text
=
value
charset
,
language
,
text
=
value
if
charset
is
None
:
# Issue 17369: if charset/lang is None, decode_rfc2231 couldn't parse
# the value, so use the fallback_charset.
charset
=
fallback_charset
rawbytes
=
bytes
(
text
,
'raw-unicode-escape'
)
rawbytes
=
bytes
(
text
,
'raw-unicode-escape'
)
try
:
try
:
return
str
(
rawbytes
,
charset
,
errors
)
return
str
(
rawbytes
,
charset
,
errors
)
...
...
Lib/test/test_email/test_email.py
Dosyayı görüntüle @
c489e834
...
@@ -5052,6 +5052,26 @@ Content-Type: application/x-foo; name*0=\"Frank's\"; name*1=\" Document\"
...
@@ -5052,6 +5052,26 @@ Content-Type: application/x-foo; name*0=\"Frank's\"; name*1=\" Document\"
self
.
assertNotIsInstance
(
param
,
tuple
)
self
.
assertNotIsInstance
(
param
,
tuple
)
self
.
assertEqual
(
param
,
"Frank's Document"
)
self
.
assertEqual
(
param
,
"Frank's Document"
)
def
test_rfc2231_missing_tick
(
self
):
m
=
'''
\
Content-Disposition: inline;
\t
filename*0*="'This
%20
is
%20
broken";
'''
msg
=
email
.
message_from_string
(
m
)
self
.
assertEqual
(
msg
.
get_filename
(),
"'This is broken"
)
def
test_rfc2231_missing_tick_with_encoded_non_ascii
(
self
):
m
=
'''
\
Content-Disposition: inline;
\t
filename*0*="'This
%20
is
%
E2broken";
'''
msg
=
email
.
message_from_string
(
m
)
self
.
assertEqual
(
msg
.
get_filename
(),
"'This is
\ufffd
broken"
)
# test_headerregistry.TestContentTypeHeader.rfc2231_single_quote_in_value_with_charset_and_lang
# test_headerregistry.TestContentTypeHeader.rfc2231_single_quote_in_value_with_charset_and_lang
def
test_rfc2231_tick_attack_extended
(
self
):
def
test_rfc2231_tick_attack_extended
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
...
...
Misc/NEWS
Dosyayı görüntüle @
c489e834
...
@@ -24,6 +24,10 @@ Core and Builtins
...
@@ -24,6 +24,10 @@ Core and Builtins
Library
Library
-------
-------
- Issue #17369: get_filename was raising an exception if the filename
parameter'
s
RFC2231
encoding
was
broken
in
certain
ways
.
This
was
a
regression
relative
to
python2
.
-
Issue
#
20013
:
Some
imap
servers
disconnect
if
the
current
mailbox
is
-
Issue
#
20013
:
Some
imap
servers
disconnect
if
the
current
mailbox
is
deleted
,
and
imaplib
did
not
handle
that
case
gracefully
.
Now
it
deleted
,
and
imaplib
did
not
handle
that
case
gracefully
.
Now
it
handles
the
'bye'
correctly
.
handles
the
'bye'
correctly
.
...
...
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