On 3/23/24 11:56, Helio Loureiro wrote:
Hi, it is python 3.10. Problem is... some mailing lists were created long ago, with python2 something. Most probably 2.5. And the tables on mysql were set to latin1.
This has nothing to do with the data or the charsets/collation in the database. The issue is the locale setting in your python is causing stdout output from the `mailman members` command to be encoded as `latin1` and at least some user's display name contains a `\u0142` (i.e. `ł` character.
That I know. Question now is how to fix this. Any suggestion? What is the table? I probably can run some script for these specific lists that have the failure, import data as latim-1, and update back to the table as utf-8.
That's not the issue. The issue is the Python in your venv has sys.stdout.encoding set to latin1, probably for locale reasons. You ca apply this patch ``` --- a/src/mailman/commands/cli_members.py +++ b/src/mailman/commands/cli_members.py @@ -17,6 +17,7 @@ """The 'members' subcommand.""" +import sys import click from mailman.core.i18n import _ @@ -30,6 +31,9 @@ from zope.component import getUtility from zope.interface import implementer +sys.stdout.reconfigure(encoding='utf-8') + + def display_members(ctx, mlist, role, regular, digest, nomail, outfp, email_only, count_only): # Which type of digest recipients should we display? ``` to mailman/commands/cli_members.py to fix the issue. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan