Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2 - Mailing list pgsql-bugs

From Jorge Gustavo Rocha
Subject Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2
Date
Msg-id 0a9fcd30-5ae2-7e5f-ac1d-60d14a2ebb63@geomaster.pt
Whole thread Raw
In response to Re: BUG #15827: Unable to connect on Windows using pg_services.confusing Python psycopg2  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #15827: Unable to connect on Windows using pg_services.confusing Python psycopg2
List 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 CONNOSCO

 
Avenida Barros e Soares
N.º 423, 4715-214 Braga
VAT/NIF
510 906 109
Phone
  +351 253 680 323
Site       geomaster.pt
GPS       41.53322, -8.41929


 
Jorge Gustavo Rocha

CTO

Mobile
  +351 910 333 888
Email    jgr@geomaster.pt

Attachment

pgsql-bugs by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: CREATE STATISTICS + Table Inheritance = ERROR: tuple alreadyupdated by self
Next
From: Etsuro Fujita
Date:
Subject: Re: Querying foreign table with SP-GiST index results in “ERROR: cache lookup failed for type 0”