Skip to content

Commit a8f3183

Browse files
author
James William Pye
committed
Correct pgpass.conf resolution on win32.
1 parent 00c745c commit a8f3183

2 files changed

Lines changed: 4 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')),

postgresql/documentation/changes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
a mechanism that would use SQL predefined type names instead of
1414
qualified names. [#1010620, Reported by Dallas Morisett]
1515
* Fix DB-API setting of rowcount after execute. [Reported by Mike Bayer; 1010643]
16+
* Fix pgpass.conf resolution on win32
1617
1718
0.8.1 released on 2009-04-30
1819
----------------------------

0 commit comments

Comments
 (0)