On 3/14/25 3:55 AM, Stefan Bauer via Mailman-users wrote:
Dear Mark,
thank you for your time.
After patching your script according to
https://github.com/maxking/docker-mailman/issues/729#issuecomment-2447542238
It fails with
/opt/mailman/venv/data# /usr/local/bin/UC_fix
/opt/mailman/venv/data/mailman3web.db
Traceback (most recent call last):
File "/usr/local/bin/UC_fix", line 77, in <module>
c.execute("delete from account_emailaddress where email = %s;",
sqlite3.OperationalError: near "%": syntax error
That patch still assumes the database is PostgreSQL. You need to replace
```
import psycopg2
```
with
```
import sqlite3
```
and
```
db = psycopg2.connect(...)
```
with
```
db = sqlite3.connect(...)
```
but it appears you've done that.
It appears that the sqlite3 module doesn't accept the '... %s', value'
syntax. See https://docs.python.org/3/library/sqlite3.html
You need to change things like
```
c.execute("""update account_emailaddress set "primary" = 't'
where email = %s;""", [em1])
```
to
```
c.execute("""update account_emailaddress set "primary" = 't'
where email = %s;""" % em1)
```
--
Mark Sapiro <m...@msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
_______________________________________________
Mailman-users mailing list -- mailman-users@mailman3.org
To unsubscribe send an email to mailman-users-le...@mailman3.org
https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Archived at:
https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/EWAGALOILP767WPPCAQIR3M4SUMITY2A/
This message sent to arch...@mail-archive.com