Well unlike yesterday, I happen to have both Intel and M1 Macs here today, and whaddya know, it does look like a psycopg bug:
Python 3.10.11 (v3.10.11:7d4cc5aa85, Apr 4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg
>>> with psycopg.connect("dbname=postgres user=dpage") as conn:
... with conn.cursor() as cur:
... cur.execute("SELECT version()")
... cur.fetchone()
...
<psycopg.Cursor [TUPLES_OK] [INTRANS] (user=dpage database=postgres) at 0x103a72610>
(b'PostgreSQL 15.1 on aarch64-apple-darwin22.1.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit',)
(venv) dpage@gibson ~ % python
Python 3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg
>>> with psycopg.connect("dbname=postgres user=dpage") as conn:
... with conn.cursor() as cur:
... cur.execute("SELECT version()")
... cur.fetchone()
...
<psycopg.Cursor [TUPLES_OK] [INTRANS] (user=dpage database=postgres) at 0x10e6c7530>
('PostgreSQL 15.2 (Homebrew) on x86_64-apple-darwin22.3.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit',)
I've raised that with the psycopg devs: https://github.com/psycopg/psycopg/issues/561
Thanks!