On 03/12/2018 03:33 PM, Dave Pascoe wrote: > Sending digests has broken on upgrade to either 2.1.25 or 2.1.26....2.1.26 > I'm pretty sure. > > Getting this error: > > Mar 12 17:50:55 2018 (17857) send_digests() failed: decode() takes no > keyword arguments > Mar 12 17:50:55 2018 (17857) Traceback (most recent call last): > File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 110, in > process > send_digests(mlist, mboxfp) > File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 158, in > send_digests > send_i18n_digests(mlist, mboxfp) > File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 313, in > send_i18n_digests > toctext = to_cset_out(toc.getvalue(), lcset) > File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 77, in > to_cset_out > return text.decode(lcset, errors='replace').encode(ocset, > TypeError: decode() takes no keyword arguments > > This is on a soon-to-be-upgraded CentOS 5 system so Python 2.4.3. Any quick > fix for ToDigest.py to make it temporarily compatible with Python 2.4.3?
As you surmise, you have discovered another Python dependency. This was introduced in 2.1.24 and depends on Python 2.7. The fix for Python 2.3 - 2.6 is simple. Part of the added code in Handlers/ToDigest.py is: > def to_cset_out(text, lcset): > # Convert text from unicode or lcset to output cset. > ocset = Charset(lcset).get_output_charset() or lcset > if isinstance(text, unicode): > return text.encode(ocset, errors='replace') > else: > return text.decode(lcset, errors='replace').encode(ocset, > errors='replace') In both of the return statements, just delete errors= so it becomes > def to_cset_out(text, lcset): > # Convert text from unicode or lcset to output cset. > ocset = Charset(lcset).get_output_charset() or lcset > if isinstance(text, unicode): > return text.encode(ocset, 'replace') > else: > return text.decode(lcset, 'replace').encode(ocset, 'replace') -- Mark Sapiro <[email protected]> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list [email protected] https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/archive%40jab.org
