File tree 1 file changed +29
-1
lines changed
1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 6
6
import subprocess
7
7
import threading
8
8
import tempfile
9
+ import platform
9
10
from queue import Queue
10
11
11
12
import time
@@ -1925,7 +1926,7 @@ def make_simple(
1925
1926
1926
1927
# Define delayed propertyes
1927
1928
if not ("unix_socket_directories" in options .keys ()):
1928
- options ["unix_socket_directories" ] = __class__ ._gettempdir ()
1929
+ options ["unix_socket_directories" ] = __class__ ._gettempdir_for_socket ()
1929
1930
1930
1931
# Set config values
1931
1932
node .set_auto_conf (options )
@@ -1938,6 +1939,33 @@ def make_simple(
1938
1939
1939
1940
return node
1940
1941
1942
+ def _gettempdir_for_socket ():
1943
+ platform_system_name = platform .system ().lower ()
1944
+
1945
+ if platform_system_name == "windows" :
1946
+ return __class__ ._gettempdir ()
1947
+
1948
+ #
1949
+ # [2025-02-17] Hot fix.
1950
+ #
1951
+ # Let's use hard coded path as Postgres likes.
1952
+ #
1953
+ # pg_config_manual.h:
1954
+ #
1955
+ # #ifndef WIN32
1956
+ # #define DEFAULT_PGSOCKET_DIR "/tmp"
1957
+ # #else
1958
+ # #define DEFAULT_PGSOCKET_DIR ""
1959
+ # #endif
1960
+ #
1961
+ # On the altlinux-10 tempfile.gettempdir() may return
1962
+ # the path to "private" temp directiry - "/temp/.private/<username>/"
1963
+ #
1964
+ # But Postgres want to find a socket file in "/tmp" (see above).
1965
+ #
1966
+
1967
+ return "/tmp"
1968
+
1941
1969
def _gettempdir ():
1942
1970
v = tempfile .gettempdir ()
1943
1971
You can’t perform that action at this time.
0 commit comments