From 3497155a03f41664f291928096c19b3bc9385e7c Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 6 Nov 2004 00:14:05 +0000 Subject: get_boundary(): Fix for SF bug #1060941. RFC 2046 says boundaries may begin -- but not end -- with whitespace. --- Lib/email/Message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/email/Message.py b/Lib/email/Message.py index b5302d7..5b76e85 100644 --- a/Lib/email/Message.py +++ b/Lib/email/Message.py @@ -747,7 +747,8 @@ class Message: # RFC 2231 encoded, so decode. It better end up as ascii charset = boundary[0] or 'us-ascii' return unicode(boundary[2], charset).encode('us-ascii') - return _unquotevalue(boundary.strip()) + # RFC 2046 says that boundaries may begin but not end in w/s + return _unquotevalue(boundary.rstrip()) def set_boundary(self, boundary): """Set the boundary parameter in Content-Type to 'boundary'. -- cgit v0.12