File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def encode_base64(msg):
2929 Also, add an appropriate Content-Transfer-Encoding header.
3030 """
3131 orig = msg .get_payload ()
32- encdata = _bencode (orig )
32+ encdata = str ( _bencode (orig ), 'ascii' )
3333 msg .set_payload (encdata )
3434 msg ['Content-Transfer-Encoding' ] = 'base64'
3535
Original file line number Diff line number Diff line change @@ -966,7 +966,8 @@ def test_guess_minor_type(self):
966966
967967 def test_encoding (self ):
968968 payload = self ._au .get_payload ()
969- self .assertEqual (base64 .decodebytes (payload ), self ._audiodata )
969+ self .assertEqual (base64 .decodebytes (bytes (payload , 'ascii' )),
970+ self ._audiodata )
970971
971972 def test_checkSetMinor (self ):
972973 au = MIMEAudio (self ._audiodata , 'fish' )
@@ -1006,7 +1007,8 @@ def test_guess_minor_type(self):
10061007
10071008 def test_encoding (self ):
10081009 payload = self ._im .get_payload ()
1009- self .assertEqual (base64 .decodebytes (payload ), self ._imgdata )
1010+ self .assertEqual (base64 .decodebytes (bytes (payload , 'ascii' )),
1011+ self ._imgdata )
10101012
10111013 def test_checkSetMinor (self ):
10121014 im = MIMEImage (self ._imgdata , 'fish' )
@@ -1046,7 +1048,7 @@ def test_body(self):
10461048 eq = self .assertEqual
10471049 bytes = b'\xfa \xfb \xfc \xfd \xfe \xff '
10481050 msg = MIMEApplication (bytes )
1049- eq (msg .get_payload (), b '+vv8/f7/' )
1051+ eq (msg .get_payload (), '+vv8/f7/' )
10501052 eq (msg .get_payload (decode = True ), bytes )
10511053
10521054
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ Finn Bock
8181Paul Boddie
8282Matthew Boedicker
8383David Bolen
84+ Forest Bond
8485Gregory Bond
8586Jurjen Bos
8687Peter Bosch
Original file line number Diff line number Diff line change 5454Library
5555-------
5656
57+ - Issue #4768: base64 encoded email body parts were incorrectly stored as
58+ binary strings. They are now correctly converted to strings.
59+
5760- Issue #8833: tarfile created hard link entries with a size field != 0 by
5861 mistake.
5962
You can’t perform that action at this time.
0 commit comments