summaryrefslogtreecommitdiffstats
path: root/Lib/email/Message.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/email/Message.py')
-rw-r--r--Lib/email/Message.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/email/Message.py b/Lib/email/Message.py
index 5e8d32f..fb121a9 100644
--- a/Lib/email/Message.py
+++ b/Lib/email/Message.py
@@ -373,7 +373,7 @@ class Message:
value = self.get('content-type', missing)
if value is missing:
return failobj
- return paramre.split(value)[0].lower()
+ return paramre.split(value)[0].lower().strip()
def get_main_type(self, failobj=None):
"""Return the message's main content type if present."""
@@ -428,11 +428,11 @@ class Message:
for p in paramre.split(value):
try:
name, val = p.split('=', 1)
- name = name.rstrip()
- val = val.lstrip()
+ name = name.strip()
+ val = val.strip()
except ValueError:
# Must have been a bare attribute
- name = p
+ name = p.strip()
val = ''
params.append((name, val))
params = Utils.decode_params(params)