Re: Feature tests on M1 Mac fail

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Yogesh Mahajan <yogesh(dot)mahajan(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Feature tests on M1 Mac fail
Date: 2023-05-11 09:13:42
Message-ID: CA+OCxozUqNByCu8ECbOemT1C0A4AZgSpxDcGXk0cF8uFP1tOVA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Thu, 11 May 2023 at 09:26, Yogesh Mahajan <
yogesh(dot)mahajan(at)enterprisedb(dot)com> wrote:

> Hi,
>
> I have tried with python 3.10. 3.11 by creating fresh venv on Mac, but I
> could not reproduce the problem.
> As you said earlier, this could be architecture specific.
> Would it be possible to provide access to above to me or if any database
> server credentials that I can use to test with.
> Simple problem over here is -
>
> pg_cursor.execute("SELECT version()") is returning, bytes object which is not expected.
>
> We can add typecasting here to fix the issue if we are sure about the exact root cause of the issue.
>
> 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(at)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!

--
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: https://www.enterprisedb.com

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Aditya Toshniwal 2023-05-11 14:13:28 [pgadmin-org/pgadmin4]
Previous Message Pravesh Sharma 2023-05-11 09:02:14 [pgadmin-org/pgadmin4] 2ec460: Fix the browser tree state that is not remembered ...