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
78099bb1
Commit
78099bb1
authored
Mar 16, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Plain Diff
Merge #9298 fix.
parents
3137d25b
6d94bd47
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
6 deletions
+21
-6
Lib/email/encoders.py
Lib/email/encoders.py
+1
-1
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+15
-5
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+4
-0
No files found.
Lib/email/encoders.py
View file @
78099bb1
...
@@ -12,7 +12,7 @@ __all__ = [
...
@@ -12,7 +12,7 @@ __all__ = [
]
]
from
base64
import
b64encode
as
_bencode
from
base64
import
encodebytes
as
_bencode
from
quopri
import
encodestring
as
_encodestring
from
quopri
import
encodestring
as
_encodestring
...
...
Lib/email/test/test_email.py
View file @
78099bb1
...
@@ -573,9 +573,18 @@ class TestMessageAPI(TestEmailBase):
...
@@ -573,9 +573,18 @@ class TestMessageAPI(TestEmailBase):
msg
[
'Dummy'
]
=
'dummy
\
n
X-Injected-Header: test'
msg
[
'Dummy'
]
=
'dummy
\
n
X-Injected-Header: test'
self
.
assertRaises
(
errors
.
HeaderParseError
,
msg
.
as_string
)
self
.
assertRaises
(
errors
.
HeaderParseError
,
msg
.
as_string
)
# Test the email.encoders module
# Test the email.encoders module
class
TestEncoders
(
unittest
.
TestCase
):
class
TestEncoders
(
unittest
.
TestCase
):
def
test_EncodersEncode_base64
(
self
):
with
openfile
(
'PyBanner048.gif'
,
'rb'
)
as
fp
:
bindata
=
fp
.
read
()
mimed
=
email
.
mime
.
image
.
MIMEImage
(
bindata
)
base64ed
=
mimed
.
get_payload
()
# the transfer-encoded body lines should all be <=76 characters
lines
=
base64ed
.
split
(
'
\
n
'
)
self
.
assertLessEqual
(
max
([
len
(
x
)
for
x
in
lines
]),
76
)
def
test_encode_empty_payload
(
self
):
def
test_encode_empty_payload
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
msg
=
Message
()
msg
=
Message
()
...
@@ -1141,10 +1150,11 @@ class TestMIMEApplication(unittest.TestCase):
...
@@ -1141,10 +1150,11 @@ class TestMIMEApplication(unittest.TestCase):
def
test_body
(
self
):
def
test_body
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
bytes
=
b'
\
xfa
\
xfb
\
xfc
\
xfd
\
xfe
\
xff
'
bytesdata
=
b'
\
xfa
\
xfb
\
xfc
\
xfd
\
xfe
\
xff
'
msg
=
MIMEApplication
(
bytes
)
msg
=
MIMEApplication
(
bytesdata
)
eq
(
msg
.
get_payload
(),
'+vv8/f7/'
)
# whitespace in the cte encoded block is RFC-irrelevant.
eq
(
msg
.
get_payload
(
decode
=
True
),
bytes
)
eq
(
msg
.
get_payload
().
strip
(),
'+vv8/f7/'
)
eq
(
msg
.
get_payload
(
decode
=
True
),
bytesdata
)
...
...
Misc/ACKS
View file @
78099bb1
...
@@ -225,6 +225,7 @@ Jaromir Dolecek
...
@@ -225,6 +225,7 @@ Jaromir Dolecek
Ismail Donmez
Ismail Donmez
Marcos Donolo
Marcos Donolo
Dima Dorfman
Dima Dorfman
Yves Dorfsman
Cesar Douady
Cesar Douady
Dean Draayer
Dean Draayer
Fred L. Drake, Jr.
Fred L. Drake, Jr.
...
...
Misc/NEWS
View file @
78099bb1
...
@@ -40,6 +40,10 @@ Core and Builtins
...
@@ -40,6 +40,10 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
9298
:
base64
bodies
weren
't being folded to line lengths less than 78,
which was a regression relative to Python2. Unlike Python2, the last line
of the folded body now ends with a carriage return.
- Issue #11560: shutil.unpack_archive now correctly handles the format
- Issue #11560: shutil.unpack_archive now correctly handles the format
parameter. Patch by Evan Dandrea.
parameter. Patch by Evan Dandrea.
...
...
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