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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jorge Gustavo Rocha <jgr@geomaster.pt>, pgsql-bugs@lists.postgresql.org
Date: 2019-06-20T07:03:19Z
Lists: pgsql-bugs

Attachments

On Thu, Jun 20, 2019 at 12:12:18PM +0900, Michael Paquier wrote:
> The discussion here is on 10, and the password file has does not
> enforce the flag either because it filters '\r' by itself.  So another
> solution may be to do the same thing as what's done in
> passwordFromFile()?

That still sounds like a good idea to do at the end.  So attached is
the Dr Evil's version I was thinking of, and that would be rather
back-patchable.  (Spoiler: not seriously tested.)

Thoughts?
--
Michael

Commits

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