On 3/1/21 11:53 AM, David Partain via Mailman-users wrote:
Thanks for being patient with me. I'm still baffled but might have found the problem.
I've done the above, to no avail.
If I look at the queries being sent to mysql, I see stuff like this:
174 Connect mailman3web@localhost<mailto:mailman3web@localhost> on mailman3web using TCP/IP
174 Query SET sql_mode='STRICT_TRANS_TABLES'
174 Query COMMIT
174 Query SET AUTOCOMMIT = 0
174 Query SET AUTOCOMMIT = 1
174 Query SET AUTOCOMMIT = 0
I note that there is nothing about the charset, so something's clearly wonky.
As previously stated, /etc/mailman3/mailman-web.py has the right thing:
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'charset': 'utf8mb4',
},
but that latter is having no effect.
I then found /var/lib/ucf/cache/:etc:mailman3:mailman-web.py which doesn't have charset
(but does have init_command), but I _think_ that's only about the package management system.
I think that's correct. I doubt that that's the problem, but if all else fails, you might just remove it. I don't think that would hurt as it's purpose is just todetect on upgrade of the package if you've changed the file from the distributed one and ask you what you want to do about it.
So... I found that /usr/share/mailman3-web/settings_local.py is just a link to /etc/mailman3/mailman-web.py
(which obviously has the right thing), but what about the .pyc file?
# grep -i STRICT_TRANS_TABLES /usr/share/mailman3-web/settings_local.pyc
Binary file /usr/share/mailman3-web/settings_local.pyc matches
# grep -i charset /usr/share/mailman3-web/settings_local.pyc
#
It ain't in the .pyc file. Am I overly optimistic that that might the be problem?
If so, I'd be grateful if someone'd tell the newbie how to recreate that file without
trashing something.
This is a bit strange: Here's how it works.
.pyc files are byte-compiled versions of the corresponding .py file.
When Python runs or imports from a .py file, it first looks for a corresponding .pyc file and if that is as new or newer than the .py, it uses the .pyc. If not, it uses the .py and byte-compiles it and if it has permission, writes an updated .pyc
Except recent Python3 (at least I think 3.5 and newer doesn't use a .pyc in the same directory as the .py Its uses a __pycache__ directory in the same directory as the .py and within that directory a file like in this case settings_local.cpython-37.pyc (or whatever the python version is)
In any case, I would remove the existing settings_local.pyc. That can't hurt, but I'm curious what
ls -lR /usr/share/mailman3-web/
shows.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan