------------------------------------------------------------
revno: 1505
fixes bug: https://launchpad.net/bugs/1397170
committer: Mark Sapiro <[email protected]>
branch nick: 2.1
timestamp: Fri 2014-11-28 12:46:22 -0800
message:
Fixed a UnicodeDecodeError that could occur in the web admin interface
if 'text' valued attributes have unicode values.
modified:
Mailman/htmlformat.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/htmlformat.py'
--- Mailman/htmlformat.py 2014-06-09 22:06:46 +0000
+++ Mailman/htmlformat.py 2014-11-28 20:46:22 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2014 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
@@ -32,7 +32,7 @@
from Mailman import mm_cfg
from Mailman import Utils
-from Mailman.i18n import _
+from Mailman.i18n import _, get_translation
from Mailman.CSRFcheck import csrf_token
@@ -441,6 +441,7 @@
self.kws = kws
def Format(self, indent=0):
+ charset = get_translation().charset() or 'us-ascii'
output = ['<INPUT name="%s" type="%s" value="%s"' %
(self.name, self.type, self.value)]
for item in self.kws.items():
@@ -448,7 +449,10 @@
if self.checked:
output.append('CHECKED')
output.append('>')
- return SPACE.join(output)
+ ret = SPACE.join(output)
+ if self.type == 'TEXT' and isinstance(ret, unicode):
+ ret = ret.encode(charset, 'replace')
+ return ret
class SubmitButton(InputObj):
@@ -486,6 +490,7 @@
self.readonly = readonly
def Format(self, indent=0):
+ charset = get_translation().charset() or 'us-ascii'
output = '<TEXTAREA NAME=%s' % self.name
if self.rows:
output += ' ROWS=%s' % self.rows
@@ -496,6 +501,8 @@
if self.readonly:
output += ' READONLY'
output += '>%s</TEXTAREA>' % self.text
+ if isinstance(output, unicode):
+ output = output.encode(charset, 'replace')
return output
class FileUpload(InputObj):
=== modified file 'NEWS'
--- NEWS 2014-11-08 01:19:05 +0000
+++ NEWS 2014-11-28 20:46:22 +0000
@@ -33,6 +33,9 @@
Bug fixes and other patches
+ - Fixed a UnicodeDecodeError that could occur in the web admin interface
+ if 'text' valued attributes have unicode values. (LP: #1397170)
+
- We now catch the NotAMemberError exception thrown if an authenticated
unsubscribe is submitted from the user options page for a nonmember.
(LP: #1390653)
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org