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 r.david.murray
Recipients barry, docs@python, r.david.murray
Date 2013-08-09.19:52:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376077941.88.0.83427598485.issue18600@psf.upfronthosting.co.za>
In-reply-to
Content
Turns out even with as_string accepting a policy keyword, the example still failed.  It needs to be generating a bytes object, not a string.  Before I even realized that, though, I decided I wanted to add as_bytes (and __bytes__).  So the attached patch does that: adds policy to as_string, and adds new methods as_bytes and __bytes__ to Message.

This patch is only for 3.4.  The 3.3 patch will just delete that part of the policy example, so I'm not going to bother to upload it.
History
Date User Action Args
2013-08-09 19:52:21r.david.murraysetrecipients: + r.david.murray, barry, docs@python
2013-08-09 19:52:21r.david.murraysetmessageid: <1376077941.88.0.83427598485.issue18600@psf.upfronthosting.co.za>
2013-08-09 19:52:21r.david.murraylinkissue18600 messages
2013-08-09 19:52:20r.david.murraycreate