Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jorge Gustavo Rocha <jgr@geomaster.pt>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2019-06-01T18:06:28Z
Lists: pgsql-bugs
Jorge Gustavo Rocha <jgr@geomaster.pt> writes:
> Hi Tom,
> Thanks for looking at this.

> I've tried with \n and \r\n separators to make sure it wasn't the
> problem. I did a od -c to make sure the endings were the expected ones,
> and I found no difference between just \n or \r\n.

> The psql is able to deal with service=pg_trabalho, so I think libpq is
> reading the file without line end issues.

Yeah, that seems like it puts libpq in the clear, but then where are
things going wrong?  I wonder if psycopg2 is not just "passing the
connection parameters down to libpq", but is reading the service
file for itself (and failing to take care about newlines).

			regards, tom lane



Commits

  1. Fix failures to ignore \r when reading Windows-style newlines.