22 Mar
2024
22 Mar
'24
8:53 p.m.
On 3/22/24 05:37, Helio Loureiro wrote:
Hi,
I just found several lists have the issue like this regarding charset:
(venv) mailman@new-mailman3 ~ (v3.1.1)> mailman members ... Traceback (most recent call last): ... line 109, in display_members print(f'{address.display_name} <{address.original_email}>', UnicodeEncodeError: 'latin-1' codec can't encode character '\u0142' in position 9: ordinal not in range(256)
There is something in your python that has set the encoding for stdout to latin1 instead of the default utf-8. E.g.
$ python3.10
Python 3.10.9 (main, Dec 11 2022, 12:59:24) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> name = 'abc\u0142def'
>>> print (f'{name}')
abcłdef
>>> import sys
>>> sys.stdout.reconfigure(encoding='latin1')
>>> print (f'{name}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0142' in
position 3: ordinal not in range(256)
>>>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan