Milter.utils.parse_header returns string, other py3 fixes

This commit is contained in:
Stuart D. Gathman
2020-06-25 19:47:38 -04:00
parent 7ea839cfb1
commit f37090371b
5 changed files with 15 additions and 8 deletions
+2 -1
View File
@@ -216,7 +216,8 @@ def parse_header(val):
u.append(s.decode())
else:
u.append(s.decode())
u = u''.join(u)
u = ''.join(u)
if type(u) is str: return u
for enc in ('us-ascii','iso-8859-1','utf-8'):
try:
return u.encode(enc)