Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1px2N9-0007UM-EO for pgadmin-hackers@arkaria.postgresql.org; Thu, 11 May 2023 09:14:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1px2N8-0003c9-Dw for pgadmin-hackers@arkaria.postgresql.org; Thu, 11 May 2023 09:14:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1px2N7-0003bz-V3 for pgadmin-hackers@lists.postgresql.org; Thu, 11 May 2023 09:14:02 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1px2N2-001ifE-RX for pgadmin-hackers@postgresql.org; Thu, 11 May 2023 09:14:00 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-965d73eb65fso1327600166b.2 for ; Thu, 11 May 2023 02:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; t=1683796434; x=1686388434; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GfrGFp7h5HgMTyxMDgaaeBPvtr3+lZ0OZ9Hl8Tn8nrc=; b=RQGjLA1cB5z2F5yZDCqvDKBLnSSsHLI4sENiSYm7sNI6FYOc1/k0lOvK5BJ2I5aUEm y4RBBTmQYQZTNveRgAK8480yXiXwRY/F4B6MyMibB1jMkcLcF+zJ3KKTBFgsLYzzc5cE viF/zoJAlvrg3CuudQoXTO64LkHAi0ivFKCTdOIt5PlwsmsHE+ntaHyk/mYfqEOmTh48 6LZ8+foGMZTAiDkooVNkTEQhUMi36a9bWuxq1XU5ueHMJnUo6T7M2UfISMPV8C3drque oso57o0DNhaABk8yU7Xk3E3wgslL+q3Tblw+5YXWEeb+1Hu/JaJSloUGFxpM34w+rkK9 FGDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683796434; x=1686388434; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GfrGFp7h5HgMTyxMDgaaeBPvtr3+lZ0OZ9Hl8Tn8nrc=; b=GQw2Y/JQ4RAbhD6afCoK05hNqzx/Ads6K0HM0bPMnOnHywns5G6VSw9vx43o/TuDJd yxslhlzERDFFnjbesv74EWHs/lnhvSfumIAOnmMUmVpS4PXx5D9m49eSn+XQlfXOlx4J qIDjfQCO4sLJRLljmCpmUIrj5o2PFlf/wCoDQeiVnBe0yuebEq3J/6K/v/Jf7tUC8CSE T5pz9IrEaTqMhwb5YzOAjoPn3Y30DAgeBPMi9jcikD2ohgeW8Gd8pKkp7BrMiyzk2R2b XCpfCg1G4QvwCPLGHyJKb2wT8klSYCwxKY/dZ1dScrWQA3rbqFR8roGAi2q1gKZ+EOhk uQWA== X-Gm-Message-State: AC+VfDx3enZ04hQ7v3IqznatGNBgAKpheupfDmiy/vLnZhW7Ak90gEz+ DLBfYa1aYQMyx3EwyOKQIW1QpOnig9qtaAS0kPfwxQ== X-Google-Smtp-Source: ACHHUZ78GdzszAoqp340YfkY5WRNGYH/npQIgJ8Pz+I9wn3GP13wQqt5X1h9od+y1zziBrL14HmERBVmMYd/Qx0VUXE= X-Received: by 2002:a17:907:160d:b0:966:5035:6973 with SMTP id hb13-20020a170907160d00b0096650356973mr16362005ejc.50.1683796433979; Thu, 11 May 2023 02:13:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Thu, 11 May 2023 10:13:42 +0100 Message-ID: Subject: Re: Feature tests on M1 Mac fail To: Yogesh Mahajan Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000525e6705fb676821" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000525e6705fb676821 Content-Type: text/plain; charset="UTF-8" Hi On Thu, 11 May 2023 at 09:26, Yogesh Mahajan < yogesh.mahajan@enterprisedb.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() ... (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() ... ('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 --000000000000525e6705fb676821 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, 11 May 2023 at 09:26, Yogesh Mahajan <yogesh.mahajan@enterprised= b.com> wrote:
Hi,

I have tried with python=C2=A0= 3.10. 3.11 by creating fresh venv on Mac, but I could not reproduce=C2=A0th= e=C2=A0problem.
As you said earlier, this could be architecture=C2=A0specific.=C2= =A0
Woul= d it be possible to provide access to above to me or if any database server= =C2=A0credentials that I can use to test with.
Simple problem over here is -=C2=A0<= /div>
p=
g_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 c=
ause of the issue.
Well unl= ike yesterday, I happen to have both Intel and M1 Macs here today, and whad= dya know, it does look like a psycopg bug:

Python 3.10.11 (v3.10.11:7d4c= c5aa85, Apr=C2=A0 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("dbn= ame=3Dpostgres user=3Ddpage") as conn:

... =C2=A0 =C2=A0 with conn.cursor() as cur:

... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cur.execute("SELECT version()")

... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cur.fetchone()=

..= .=C2=A0

<psycopg.Cursor [T= UPLES_OK] [INTRANS] (user=3Ddpage database=3Dpostgres) at 0x103a72610>

(b'= ;PostgreSQL 15.1 on aarch64-apple-darwin22.1.0, compiled by Apple clang ver= sion 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 ps= ycopg

>>> with psyc= opg.connect("dbname=3Dpostgres user=3Ddpage") as conn:

... =C2=A0 =C2=A0 with conn.cursor() as cur:

... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = cur.execute("SELECT version()")

... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = cur.fetchone()

...

<psycopg.Cursor [TU= PLES_OK] [INTRANS] (user=3Ddpage database=3Dpostgres) 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:=C2=A0https://github.com/psycopg/ps= ycopg/issues/561


Than= ks!


-- <= br>
--000000000000525e6705fb676821--