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
7da8f06d
Commit
7da8f06d
authored
Jun 04, 2010
by
R. David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4768: store base64 encoded email body parts as text, not binary.
Patch and tests by Forest Bond.
parent
deda8cb8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
Lib/email/encoders.py
Lib/email/encoders.py
+1
-1
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+5
-3
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/email/encoders.py
View file @
7da8f06d
...
@@ -29,7 +29,7 @@ def encode_base64(msg):
...
@@ -29,7 +29,7 @@ def encode_base64(msg):
Also, add an appropriate Content-Transfer-Encoding header.
Also, add an appropriate Content-Transfer-Encoding header.
"""
"""
orig
=
msg
.
get_payload
()
orig
=
msg
.
get_payload
()
encdata
=
_bencode
(
orig
)
encdata
=
str
(
_bencode
(
orig
),
'ascii'
)
msg
.
set_payload
(
encdata
)
msg
.
set_payload
(
encdata
)
msg
[
'Content-Transfer-Encoding'
]
=
'base64'
msg
[
'Content-Transfer-Encoding'
]
=
'base64'
...
...
Lib/email/test/test_email.py
View file @
7da8f06d
...
@@ -970,7 +970,8 @@ class TestMIMEAudio(unittest.TestCase):
...
@@ -970,7 +970,8 @@ class TestMIMEAudio(unittest.TestCase):
def
test_encoding
(
self
):
def
test_encoding
(
self
):
payload
=
self
.
_au
.
get_payload
()
payload
=
self
.
_au
.
get_payload
()
self
.
assertEqual
(
base64
.
decodebytes
(
payload
),
self
.
_audiodata
)
self
.
assertEqual
(
base64
.
decodebytes
(
bytes
(
payload
,
'ascii'
)),
self
.
_audiodata
)
def
test_checkSetMinor
(
self
):
def
test_checkSetMinor
(
self
):
au
=
MIMEAudio
(
self
.
_audiodata
,
'fish'
)
au
=
MIMEAudio
(
self
.
_audiodata
,
'fish'
)
...
@@ -1010,7 +1011,8 @@ class TestMIMEImage(unittest.TestCase):
...
@@ -1010,7 +1011,8 @@ class TestMIMEImage(unittest.TestCase):
def
test_encoding
(
self
):
def
test_encoding
(
self
):
payload
=
self
.
_im
.
get_payload
()
payload
=
self
.
_im
.
get_payload
()
self
.
assertEqual
(
base64
.
decodebytes
(
payload
),
self
.
_imgdata
)
self
.
assertEqual
(
base64
.
decodebytes
(
bytes
(
payload
,
'ascii'
)),
self
.
_imgdata
)
def
test_checkSetMinor
(
self
):
def
test_checkSetMinor
(
self
):
im
=
MIMEImage
(
self
.
_imgdata
,
'fish'
)
im
=
MIMEImage
(
self
.
_imgdata
,
'fish'
)
...
@@ -1050,7 +1052,7 @@ class TestMIMEApplication(unittest.TestCase):
...
@@ -1050,7 +1052,7 @@ class TestMIMEApplication(unittest.TestCase):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
bytes
=
b'
\
xfa
\
xfb
\
xfc
\
xfd
\
xfe
\
xff
'
bytes
=
b'
\
xfa
\
xfb
\
xfc
\
xfd
\
xfe
\
xff
'
msg
=
MIMEApplication
(
bytes
)
msg
=
MIMEApplication
(
bytes
)
eq
(
msg
.
get_payload
(),
b
'+vv8/f7/'
)
eq
(
msg
.
get_payload
(),
'+vv8/f7/'
)
eq
(
msg
.
get_payload
(
decode
=
True
),
bytes
)
eq
(
msg
.
get_payload
(
decode
=
True
),
bytes
)
...
...
Misc/ACKS
View file @
7da8f06d
...
@@ -83,6 +83,7 @@ Finn Bock
...
@@ -83,6 +83,7 @@ Finn Bock
Paul Boddie
Paul Boddie
Matthew Boedicker
Matthew Boedicker
David Bolen
David Bolen
Forest Bond
Gawain Bolton
Gawain Bolton
Gregory Bond
Gregory Bond
Jurjen Bos
Jurjen Bos
...
...
Misc/NEWS
View file @
7da8f06d
...
@@ -398,6 +398,9 @@ C-API
...
@@ -398,6 +398,9 @@ C-API
Library
Library
-------
-------
- Issue #4768: base64 encoded email body parts were incorrectly stored as
binary strings. They are now correctly converted to strings.
- Issue #8833: tarfile created hard link entries with a size field != 0 by
- Issue #8833: tarfile created hard link entries with a size field != 0 by
mistake.
mistake.
...
...
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