Merge authors: Yasuhito FUTATSUKI at POEM (futatuki) Related merge proposals: https://code.launchpad.net/~futatuki/mailman/enhance-i18n-list-overview/+merge/348365 proposed by: Yasuhito FUTATSUKI at POEM (futatuki) review: Needs Information - Mark Sapiro (msapiro) ------------------------------------------------------------ revno: 1782 [merge] committer: Mark Sapiro <m...@msapiro.net> branch nick: 2.1 timestamp: Fri 2018-06-22 08:36:36 -0700 message: Fixed garbled descriptions on admin and listinfo pages. modified: Mailman/Cgi/admin.py Mailman/Cgi/listinfo.py Mailman/HTMLFormatter.py Mailman/MailList.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/Cgi/admin.py' --- Mailman/Cgi/admin.py 2018-06-18 11:35:51 +0000 +++ Mailman/Cgi/admin.py 2018-06-22 00:34:52 +0000 @@ -295,7 +295,7 @@ else: advertised.append((mlist.GetScriptURL('admin'), mlist.real_name, - mlist.description)) + Utils.websafe(mlist.GetDescription()))) # Greeting depends on whether there was an error or not if msg: greeting = FontAttr(msg, color="ff5060", size="+1") === modified file 'Mailman/Cgi/listinfo.py' --- Mailman/Cgi/listinfo.py 2018-06-03 20:19:49 +0000 +++ Mailman/Cgi/listinfo.py 2018-06-21 16:23:09 +0000 @@ -114,7 +114,7 @@ else: advertised.append((mlist.GetScriptURL('listinfo'), mlist.real_name, - Utils.websafe(mlist.description))) + Utils.websafe(mlist.GetDescription()))) if msg: greeting = FontAttr(msg, color="ff5060", size="+1") else: === modified file 'Mailman/HTMLFormatter.py' --- Mailman/HTMLFormatter.py 2018-06-17 23:47:34 +0000 +++ Mailman/HTMLFormatter.py 2018-06-22 00:34:52 +0000 @@ -389,11 +389,16 @@ listlangs = _(Utils.GetLanguageDescr(self.preferred_language)) else: listlangs = self.GetLangSelectBox(lang).Format() + if lang: + cset = Utils.GetCharSet(lang) or 'us-ascii' + else: + cset = Utils.GetCharSet(self.preferred_language) or 'us-ascii' d = { '<mm-mailman-footer>' : self.GetMailmanFooter(), '<mm-list-name>' : self.real_name, '<mm-email-user>' : self._internal_name, - '<mm-list-description>' : Utils.websafe(self.description), + '<mm-list-description>' : + Utils.websafe(self.GetDescription(cset)), '<mm-list-info>' : '<!---->' + BR.join(self.info.split(NL)) + '<!---->', '<mm-form-end>' : self.FormatFormEnd(), === modified file 'Mailman/MailList.py' --- Mailman/MailList.py 2018-06-18 11:35:51 +0000 +++ Mailman/MailList.py 2018-06-21 16:23:09 +0000 @@ -262,6 +262,27 @@ user = Utils.ObscureEmail(user) return '%s/%s' % (url, urllib.quote(user.lower())) + def GetDescription(self, cset=None, errors='xmlcharrefreplace'): + # Get list's description in charset specified by cset. + # If cset is None, it uses charset of context language. + mcset = Utils.GetCharSet(self.preferred_language) + if cset is None: + # translation context may not be initialized + trns = i18n.get_translation() + if trns is None: + ccset = 'us-ascii' + else: + ccset = i18n.get_translation().charset() or 'us-ascii' + else: + ccset = cset + if isinstance(self.description, unicode): + return self.description.encode(ccset, errors) + if mcset == ccset: + return self.description + return Utils.xml_to_unicode(self.description, mcset).encode(ccset, + errors) + + # # Instance and subcomponent initialization === modified file 'NEWS' --- NEWS 2018-06-17 21:44:53 +0000 +++ NEWS 2018-06-22 15:36:36 +0000 @@ -94,6 +94,10 @@ - Approving a held subscription for a user with a 'different' preferred language no longer corrupts the results page. (LP: #1777222) + - An issue with garbled descriptions on listinfo and admin overview pages + and the heading of a list's listinfo page due to incompatible character + sets has been fixed thanks to Yasuhito FUTATSUKI. + Miscellaneous - Added to the contrib directory, a script from Jim Popovitch to generate
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org