Skip to content

Commit 7fab752

Browse files
author
James William Pye
committed
Cat it to pgdata not appdata.
Should fix pgpass resolution on windows.
1 parent 9f5a2f1 commit 7fab752

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

postgresql/clientparameters.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ def defaults(environ = os.environ):
128128

129129
# If appdata is available, override the pgdata and pgpassfile
130130
# configuration settings.
131-
pgpassfile = os.path.join(userdir, pg_home_passfile)
132131
if sys.platform == 'win32':
133132
appdata = environ.get('APPDATA')
134133
if appdata:
135134
pgdata = os.path.join(appdata, pg_appdata_directory)
136-
pgpassfile = os.path.join(appdata, pg_appdata_passfile)
135+
pgpassfile = os.path.join(pgdata, pg_appdata_passfile)
136+
else:
137+
pgpassfile = os.path.join(userdir, pg_home_passfile)
137138

138139
for k, v in (
139140
('sslcrtfile', os.path.join(pgdata, 'postgresql.crt')),

0 commit comments

Comments
 (0)