Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2
Jorge Gustavo Rocha <jgr@geomaster.pt>
From: Jorge Gustavo Rocha <jgr@geomaster.pt>
To: Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2019-06-20T08:48:25Z
Lists: pgsql-bugs
Hi Michael, Às 08:03 de 20/06/19, Michael Paquier escreveu: > 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? I've tested your patch and it works. I've just did a small test in Ubuntu and Windows using MS VSC 2019. Your version is compiler independent, while Tom's patch was still relying on MSC fgets behavior (stripping \r if the file is opened in text mode). Both patches works and fixes the problem, but this one is compiler independent. If this can be back ported, it would be perfect! Thanks for your patch. Regards, Jorge Gustavo > -- > Michael -- Logo* Geomaster, LDA* *VENHA DESCOBRIR O CAMINHO DO OPEN SOURCE CONNOSC**O * Avenida Barros e Soares N.º 423, 4715-214 Braga VAT/NIF510 906 109 Phone +351 253 680 323 Site geomaster.pt <http://geomaster.pt> GPS 41.53322, -8.41929 ------------------------------------------------------------------------ Jorge Gustavo Rocha CTO Mobile +351 910 333 888 Email jgr@geomaster.pt
Commits
-
Fix failures to ignore \r when reading Windows-style newlines.
- 8c52b77ddea7 9.4.24 landed
- 6266654db7fa 9.5.19 landed
- ba27151d1eb0 9.6.15 landed
- cb65b454f87b 10.10 landed
- 11a0a4db3cdb 11.5 landed
- c58cf97f2fc4 12.0 landed
- b654714f9bcf 13.0 landed