]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix(windows): resolve absolute path to libpq
authorAlessandro Della Villa <kemosh@users.noreply.github.com>
Sat, 28 Sep 2024 14:12:40 +0000 (16:12 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 29 Sep 2024 13:37:25 +0000 (15:37 +0200)
Might solve the problem mentioned in the comments in #912.

psycopg/psycopg/pq/misc.py

index d5ab483e936cf707f61308068352398dfb2a1bbd..cb95e5ef2f80a220c1928f2a34a82fbf3a43e918 100644 (file)
@@ -12,6 +12,7 @@ import sys
 import logging
 import ctypes.util
 from typing import NamedTuple
+from pathlib import Path
 
 from . import abc
 from ._enums import ConnStatus, TransactionStatus, PipelineStatus
@@ -52,6 +53,7 @@ class PGresAttDesc(NamedTuple):
 def find_libpq_full_path() -> str | None:
     if sys.platform == "win32":
         libname = ctypes.util.find_library("libpq.dll")
+        libname = str(Path(libname).resolve())
 
     elif sys.platform == "darwin":
         libname = ctypes.util.find_library("libpq.dylib")