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
1f571c6e
Kaydet (Commit)
1f571c6e
authored
Agu 03, 2008
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove Barry's love of deprecated syntax to silence warnings in the email
package, when run under -3, about using <>.
üst
b2f49ff8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
base64mime.py
Lib/email/base64mime.py
+1
-1
charset.py
Lib/email/charset.py
+2
-2
generator.py
Lib/email/generator.py
+1
-1
header.py
Lib/email/header.py
+2
-2
message.py
Lib/email/message.py
+6
-6
quoprimime.py
Lib/email/quoprimime.py
+1
-1
No files found.
Lib/email/base64mime.py
Dosyayı görüntüle @
1f571c6e
...
@@ -145,7 +145,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL):
...
@@ -145,7 +145,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL):
# BAW: should encode() inherit b2a_base64()'s dubious behavior in
# BAW: should encode() inherit b2a_base64()'s dubious behavior in
# adding a newline to the encoded string?
# adding a newline to the encoded string?
enc
=
b2a_base64
(
s
[
i
:
i
+
max_unencoded
])
enc
=
b2a_base64
(
s
[
i
:
i
+
max_unencoded
])
if
enc
.
endswith
(
NL
)
and
eol
<>
NL
:
if
enc
.
endswith
(
NL
)
and
eol
!=
NL
:
enc
=
enc
[:
-
1
]
+
eol
enc
=
enc
[:
-
1
]
+
eol
encvec
.
append
(
enc
)
encvec
.
append
(
enc
)
return
EMPTYSTRING
.
join
(
encvec
)
return
EMPTYSTRING
.
join
(
encvec
)
...
...
Lib/email/charset.py
Dosyayı görüntüle @
1f571c6e
...
@@ -253,7 +253,7 @@ class Charset:
...
@@ -253,7 +253,7 @@ class Charset:
Returns "base64" if self.body_encoding is BASE64.
Returns "base64" if self.body_encoding is BASE64.
Returns "7bit" otherwise.
Returns "7bit" otherwise.
"""
"""
assert
self
.
body_encoding
<>
SHORTEST
assert
self
.
body_encoding
!=
SHORTEST
if
self
.
body_encoding
==
QP
:
if
self
.
body_encoding
==
QP
:
return
'quoted-printable'
return
'quoted-printable'
elif
self
.
body_encoding
==
BASE64
:
elif
self
.
body_encoding
==
BASE64
:
...
@@ -263,7 +263,7 @@ class Charset:
...
@@ -263,7 +263,7 @@ class Charset:
def
convert
(
self
,
s
):
def
convert
(
self
,
s
):
"""Convert a string from the input_codec to the output_codec."""
"""Convert a string from the input_codec to the output_codec."""
if
self
.
input_codec
<>
self
.
output_codec
:
if
self
.
input_codec
!=
self
.
output_codec
:
return
unicode
(
s
,
self
.
input_codec
)
.
encode
(
self
.
output_codec
)
return
unicode
(
s
,
self
.
input_codec
)
.
encode
(
self
.
output_codec
)
else
:
else
:
return
s
return
s
...
...
Lib/email/generator.py
Dosyayı görüntüle @
1f571c6e
...
@@ -211,7 +211,7 @@ class Generator:
...
@@ -211,7 +211,7 @@ class Generator:
# doesn't preserve newlines/continuations in headers. This is no big
# doesn't preserve newlines/continuations in headers. This is no big
# deal in practice, but turns out to be inconvenient for the unittest
# deal in practice, but turns out to be inconvenient for the unittest
# suite.
# suite.
if
msg
.
get_boundary
()
<>
boundary
:
if
msg
.
get_boundary
()
!=
boundary
:
msg
.
set_boundary
(
boundary
)
msg
.
set_boundary
(
boundary
)
# If there's a preamble, write it out, with a trailing CRLF
# If there's a preamble, write it out, with a trailing CRLF
if
msg
.
preamble
is
not
None
:
if
msg
.
preamble
is
not
None
:
...
...
Lib/email/header.py
Dosyayı görüntüle @
1f571c6e
...
@@ -249,7 +249,7 @@ class Header:
...
@@ -249,7 +249,7 @@ class Header:
elif
not
isinstance
(
charset
,
Charset
):
elif
not
isinstance
(
charset
,
Charset
):
charset
=
Charset
(
charset
)
charset
=
Charset
(
charset
)
# If the charset is our faux 8bit charset, leave the string unchanged
# If the charset is our faux 8bit charset, leave the string unchanged
if
charset
<>
'8bit'
:
if
charset
!=
'8bit'
:
# We need to test that the string can be converted to unicode and
# We need to test that the string can be converted to unicode and
# back to a byte string, given the input and output codecs of the
# back to a byte string, given the input and output codecs of the
# charset.
# charset.
...
@@ -455,7 +455,7 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars):
...
@@ -455,7 +455,7 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars):
# If this part is longer than maxlen and we aren't already
# If this part is longer than maxlen and we aren't already
# splitting on whitespace, try to recursively split this line
# splitting on whitespace, try to recursively split this line
# on whitespace.
# on whitespace.
if
partlen
>
maxlen
and
ch
<>
' '
:
if
partlen
>
maxlen
and
ch
!=
' '
:
subl
=
_split_ascii
(
part
,
maxlen
,
restlen
,
subl
=
_split_ascii
(
part
,
maxlen
,
restlen
,
continuation_ws
,
' '
)
continuation_ws
,
' '
)
lines
.
extend
(
subl
[:
-
1
])
lines
.
extend
(
subl
[:
-
1
])
...
...
Lib/email/message.py
Dosyayı görüntüle @
1f571c6e
...
@@ -252,7 +252,7 @@ class Message:
...
@@ -252,7 +252,7 @@ class Message:
charset
=
charset
.
get_output_charset
())
charset
=
charset
.
get_output_charset
())
else
:
else
:
self
.
set_param
(
'charset'
,
charset
.
get_output_charset
())
self
.
set_param
(
'charset'
,
charset
.
get_output_charset
())
if
str
(
charset
)
<>
charset
.
get_output_charset
():
if
str
(
charset
)
!=
charset
.
get_output_charset
():
self
.
_payload
=
charset
.
body_encode
(
self
.
_payload
)
self
.
_payload
=
charset
.
body_encode
(
self
.
_payload
)
if
not
self
.
has_key
(
'Content-Transfer-Encoding'
):
if
not
self
.
has_key
(
'Content-Transfer-Encoding'
):
cte
=
charset
.
get_body_encoding
()
cte
=
charset
.
get_body_encoding
()
...
@@ -301,7 +301,7 @@ class Message:
...
@@ -301,7 +301,7 @@ class Message:
name
=
name
.
lower
()
name
=
name
.
lower
()
newheaders
=
[]
newheaders
=
[]
for
k
,
v
in
self
.
_headers
:
for
k
,
v
in
self
.
_headers
:
if
k
.
lower
()
<>
name
:
if
k
.
lower
()
!=
name
:
newheaders
.
append
((
k
,
v
))
newheaders
.
append
((
k
,
v
))
self
.
_headers
=
newheaders
self
.
_headers
=
newheaders
...
@@ -438,7 +438,7 @@ class Message:
...
@@ -438,7 +438,7 @@ class Message:
return
self
.
get_default_type
()
return
self
.
get_default_type
()
ctype
=
paramre
.
split
(
value
)[
0
]
.
lower
()
.
strip
()
ctype
=
paramre
.
split
(
value
)[
0
]
.
lower
()
.
strip
()
# RFC 2045, section 5.2 says if its invalid, use text/plain
# RFC 2045, section 5.2 says if its invalid, use text/plain
if
ctype
.
count
(
'/'
)
<>
1
:
if
ctype
.
count
(
'/'
)
!=
1
:
return
'text/plain'
return
'text/plain'
return
ctype
return
ctype
...
@@ -601,7 +601,7 @@ class Message:
...
@@ -601,7 +601,7 @@ class Message:
ctype
=
append_param
ctype
=
append_param
else
:
else
:
ctype
=
SEMISPACE
.
join
([
ctype
,
append_param
])
ctype
=
SEMISPACE
.
join
([
ctype
,
append_param
])
if
ctype
<>
self
.
get
(
header
):
if
ctype
!=
self
.
get
(
header
):
del
self
[
header
]
del
self
[
header
]
self
[
header
]
=
ctype
self
[
header
]
=
ctype
...
@@ -617,13 +617,13 @@ class Message:
...
@@ -617,13 +617,13 @@ class Message:
return
return
new_ctype
=
''
new_ctype
=
''
for
p
,
v
in
self
.
get_params
(
header
=
header
,
unquote
=
requote
):
for
p
,
v
in
self
.
get_params
(
header
=
header
,
unquote
=
requote
):
if
p
.
lower
()
<>
param
.
lower
():
if
p
.
lower
()
!=
param
.
lower
():
if
not
new_ctype
:
if
not
new_ctype
:
new_ctype
=
_formatparam
(
p
,
v
,
requote
)
new_ctype
=
_formatparam
(
p
,
v
,
requote
)
else
:
else
:
new_ctype
=
SEMISPACE
.
join
([
new_ctype
,
new_ctype
=
SEMISPACE
.
join
([
new_ctype
,
_formatparam
(
p
,
v
,
requote
)])
_formatparam
(
p
,
v
,
requote
)])
if
new_ctype
<>
self
.
get
(
header
):
if
new_ctype
!=
self
.
get
(
header
):
del
self
[
header
]
del
self
[
header
]
self
[
header
]
=
new_ctype
self
[
header
]
=
new_ctype
...
...
Lib/email/quoprimime.py
Dosyayı görüntüle @
1f571c6e
...
@@ -287,7 +287,7 @@ def decode(encoded, eol=NL):
...
@@ -287,7 +287,7 @@ def decode(encoded, eol=NL):
n
=
len
(
line
)
n
=
len
(
line
)
while
i
<
n
:
while
i
<
n
:
c
=
line
[
i
]
c
=
line
[
i
]
if
c
<>
'='
:
if
c
!=
'='
:
decoded
+=
c
decoded
+=
c
i
+=
1
i
+=
1
# Otherwise, c == "=". Are we at the end of the line? If so, add
# Otherwise, c == "=". Are we at the end of the line? If so, add
...
...
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