------------------------------------------------------------
revno: 1701
fixes bug: https://launchpad.net/bugs/1525954
committer: Mark Sapiro <[email protected]>
branch nick: 2.1
timestamp: Fri 2017-05-12 12:17:13 -0700
message:
Improvements in subject prefixing with encoded prefixes.
modified:
Mailman/Handlers/CookHeaders.py
NEWS
--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1
Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Handlers/CookHeaders.py'
--- Mailman/Handlers/CookHeaders.py 2016-11-24 16:24:14 +0000
+++ Mailman/Handlers/CookHeaders.py 2017-05-12 19:17:13 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2017 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -423,9 +423,11 @@
recolon = 'Re:'
else:
recolon = ''
+ # Strip leading and trailing whitespace from subject.
+ subject = subject.strip()
# At this point, subject may become null if someone post mail with
- # subject: [subject prefix]
- if subject.strip() == '':
+ # Subject: [subject prefix]
+ if subject == '':
# We want the i18n context to be the list's preferred_language. It
# could be the poster's.
otrans = i18n.get_translation()
@@ -462,10 +464,10 @@
pass
# Get the header as a Header instance, with proper unicode conversion
# Because of rfc2047 encoding, spaces between encoded words can be
- # insignificant, so we need to append a space to prefix but only when
- # we have Re:.
+ # insignificant, so we need to append spaces to our encoded stuff.
+ prefix += ' '
if recolon:
- prefix += ' '
+ recolon += ' '
if old_style:
h = uheader(mlist, recolon, 'Subject', continuation_ws=ws)
h.append(prefix)
=== modified file 'NEWS'
--- NEWS 2017-04-26 05:33:19 +0000
+++ NEWS 2017-05-12 19:17:13 +0000
@@ -32,6 +32,11 @@
Bug fixes and other patches
+ - Subject prefixing has been improved to always have a space between
+ the prefix and the subject even with non-ascii in the prefix. This
+ will sometimes result in two spaces when the prefix is non-ascii but
+ the subject is ascii, but this is the lesser evil. (LP: #1525954)
+
- Treat message and digest headers and footers as empty if they contain
only whitespace. (LP: #1673307)
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org