public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pgadmin4] rawhide: Add patch to fix compatibility with pgadmin3 (#2527807)
@ 2026-09-03  8:38 Sandro Mani
  0 siblings, 0 replies; only message in thread
From: Sandro Mani @ 2026-09-03  8:38 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/pgadmin4
Branch : rawhide
Commit : 78bab7a7763c9c4e5842365b3b43aa6730e95f25
Author : Sandro Mani <manisandro@gmail.com>
Date   : 2026-09-03T10:38:08+02:00
Stats  : +56/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/pgadmin4/c/78bab7a7763c9c4e5842365b3b43aa6730e95f25?branch=rawhide

Log:
Add patch to fix compatibility with pgadmin3 (#2527807)

---
diff --git a/pgadmin4.spec b/pgadmin4.spec
index 06a231d..b127379 100644
--- a/pgadmin4.spec
+++ b/pgadmin4.spec
@@ -7,7 +7,7 @@ Name:           pgadmin4
 # NOTE: Also regenerate requires as indicated below when updating!
 # Verify Patch4 on next update
 Version:        9.17
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Administration tool for PostgreSQL
 
 # i686, armv7hl: The webpack terser plugin aborts with JS heap memory exhaustion on these arches
@@ -37,6 +37,8 @@ Patch0:         pgadmin4_requirements.patch
 Patch1:         pgadmin4_azure-mgmt-rdbms.patch
 # Drop requirement on unpackaged python-sphinxcontrib-youtube
 Patch2:         pgadmin4_sphinx_youtube.patch
+# Fix compatibility with psycopg3-3.5
+Patch3:         pgadmin4_psycopg3.patch
 
 # For docs
 BuildRequires:  glibc-langpack-en
@@ -249,6 +251,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
 
 
 %changelog
+* Thu Sep 03 2026 Sandro Mani <manisandro@gmail.com> - 9.17-2
+- Add patch to fix compatibility with pgadmin3 (#2527807)
+
 * Fri Jul 31 2026 Sandro Mani <manisandro@gmail.com> - 9.17-1
 - Update to 9.17
 

diff --git a/pgadmin4_psycopg3.patch b/pgadmin4_psycopg3.patch
new file mode 100644
index 0000000..0af6fd0
--- /dev/null
+++ b/pgadmin4_psycopg3.patch
@@ -0,0 +1,50 @@
+diff -rupN pgadmin4-9.17/web/pgadmin/utils/driver/psycopg3/encoding.py pgadmin4-9.17-new/web/pgadmin/utils/driver/psycopg3/encoding.py
+--- pgadmin4-9.17/web/pgadmin/utils/driver/psycopg3/encoding.py	2026-07-30 05:14:00.000000000 +0200
++++ pgadmin4-9.17-new/web/pgadmin/utils/driver/psycopg3/encoding.py	2026-09-03 10:34:59.822183347 +0200
+@@ -43,8 +43,12 @@ def get_encoding(key):
+         current_app.logger.error(e)
+         postgres_encoding = 'utf-8'
+ 
+-    python_encoding = psycopg._encodings._py_codecs.get(postgres_encoding,
+-                                                        'utf-8')
++    if isinstance(psycopg._encodings._py_codecs, dict):
++        python_encoding = psycopg._encodings._py_codecs.get(postgres_encoding,
++                                                            'utf-8')
++    else:
++        python_encoding = psycopg._encodings.py_codecs.get(
++            postgres_encoding.upper().encode(), 'utf-8')
+ 
+     _dict = encode_dict.get(postgres_encoding.upper(),
+                             [postgres_encoding,
+@@ -59,11 +63,23 @@ def configure_driver_encodings(encodings
+     # because for parameterized DML, param values are converted based on
+     # python encoding of pyscopg's internal encodings dict.
+ 
+-    for key, val in encode_dict.items():
+-        _, python_encoding = val
+-        psycopg._encodings._py_codecs[key] = python_encoding
+-
+-    encodings.update((k.encode(), v
+-                      ) for k, v in psycopg._encodings._py_codecs.items())
+-    psycopg._encodings.pg_codecs = {
+-        v: k.encode() for k, v in psycopg._encodings._py_codecs.items()}
++    # psycopg._encodings._py_codecs is a private symbol: it was a
++    # dict[str, str] up to psycopg 3.3.4 and became a tuple of alias
++    # groups in 3.3.5. Update the public py_codecs/pg_codecs maps that
++    # pg2pyenc()/py2pgenc() actually look at, instead of rebuilding them
++    # from the private one.
++
++    if isinstance(psycopg._encodings._py_codecs, dict):
++        for key, val in encode_dict.items():
++            _, python_encoding = val
++            psycopg._encodings._py_codecs[key] = python_encoding
++
++        encodings.update((k.encode(), v
++                        ) for k, v in psycopg._encodings._py_codecs.items())
++        psycopg._encodings.pg_codecs = {
++            v: k.encode() for k, v in psycopg._encodings._py_codecs.items()}
++    else:
++        for key, val in encode_dict.items():
++            _, python_encoding = val
++            encodings[key.encode()] = python_encoding
++            psycopg._encodings.pg_codecs[python_encoding] = key.encode()

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-03  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03  8:38 [rpms/pgadmin4] rawhide: Add patch to fix compatibility with pgadmin3 (#2527807) Sandro Mani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox