This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yves@zioup.com
Recipients barry, r.david.murray, vunruh, yves@zioup.com
Date 2011-02-13.07:17:17
SpamBayes Score 2.5971285e-05
Marked as misclassified No
Message-id <1297581438.2.0.302906066096.issue9298@psf.upfronthosting.co.za>
In-reply-to
Content
I've got two issues with this code (Lib/email/test/test_email.py):


1128     def test_body(self):
1129         eq = self.assertEqual
1130         bytes = b'\xfa\xfb\xfc\xfd\xfe\xff'
1131         msg = MIMEApplication(bytes)
1132         eq(msg.get_payload(), '+vv8/f7/')
1133         eq(msg.get_payload(decode=True), bytes)

1) Even though it works, I find the use of a defined type as the name of a variable confusing (line 1130, bytes).

2) The test on line 1132 fails if the base64 payload has an extra newline at the end, but newlines are not an issue in base64 and are actually expected. In fact the test at line 1133 shows that once decoded, the bytes are reverted to their original form.

Is there a way to find who is the author of this test, and what was the intent? Would the following test be acceptable (still testing a valid base64 encoding):

eq(msg.get_payload().strip(), '+vv8/f7/')


Thanks.
History
Date User Action Args
2011-02-13 07:17:18yves@zioup.comsetrecipients: + yves@zioup.com, barry, r.david.murray, vunruh
2011-02-13 07:17:18yves@zioup.comsetmessageid: <1297581438.2.0.302906066096.issue9298@psf.upfronthosting.co.za>
2011-02-13 07:17:17yves@zioup.comlinkissue9298 messages
2011-02-13 07:17:17yves@zioup.comcreate