From: Barry Warsaw Date: Fri, 4 Apr 2003 02:46:38 +0000 (+0000) Subject: Backporting: X-Git-Tag: v2.2.3c1~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a1d0f563868ef001329d76cdd85d522d245142f;p=thirdparty%2FPython%2Fcpython.git Backporting: revision 1.27 date: 2003/03/30 20:46:47; author: bwarsaw; state: Exp; lines: +3 -3 __unicode__(): Fix the logic for calculating whether to add a separating space or not between encoded chunks. Closes SF bug #710498. --- diff --git a/Lib/email/Header.py b/Lib/email/Header.py index 624e7c445b91..76fffb597056 100644 --- a/Lib/email/Header.py +++ b/Lib/email/Header.py @@ -215,11 +215,11 @@ class Header: # charset. Only do this for the second and subsequent chunks. nextcs = charset if uchunks: - if lastcs is not None: - if nextcs is None or nextcs == 'us-ascii': + if lastcs not in (None, 'us-ascii'): + if nextcs in (None, 'us-ascii'): uchunks.append(USPACE) nextcs = None - elif nextcs is not None and nextcs <> 'us-ascii': + elif nextcs not in (None, 'us-ascii'): uchunks.append(USPACE) lastcs = nextcs uchunks.append(unicode(s, str(charset)))