We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f77552 commit 2ba65c1Copy full SHA for 2ba65c1
1 file changed
Mailman/Cgi/admindb.py
@@ -376,9 +376,16 @@ def show_pending_subs(mlist, form):
376
CheckBox(f'ban-%d' % id, 1).Format() +
377
' ' + _('Permanently ban from this list') +
378
'</label>')
379
- # While the address may be a unicode, it must be ascii
380
- paddr = addr.encode('us-ascii', 'replace')
381
- table.AddRow(['%s<br><em>%s</em><br>%s' % (paddr,
+ # Ensure the address is properly decoded for display
+ if isinstance(addr, bytes):
+ try:
382
+ addr = addr.decode('utf-8')
383
+ except UnicodeDecodeError:
384
385
+ addr = addr.decode('latin-1')
386
387
+ addr = addr.decode('ascii', 'replace')
388
+ table.AddRow(['%s<br><em>%s</em><br>%s' % (Utils.websafe(addr),
389
Utils.websafe(fullname),
390
displaytime),
391
radio,
0 commit comments