From: Jorge Gustavo Rocha <jgr@geomaster.pt>
To: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2
Date: Thu, 20 Jun 2019 09:48:25 +0100
Message-ID: <0a9fcd30-5ae2-7e5f-ac1d-60d14a2ebb63@geomaster.pt> (raw)
In-Reply-To: <20190620070319.GH2660@paquier.xyz>
References: <15827-e6ba53a3a7ed543c@postgresql.org>
<82491.1559409563@sss.pgh.pa.us>
<e12a23c6-5e00-3fa6-6179-681336130361@geomaster.pt>
<1473.1560866085@sss.pgh.pa.us>
<fcb5c34c-cf5f-6dc9-c68e-6b297f073b79@geomaster.pt>
<CA+mi_8aBnLKypX2Ttksg8JEhApBo=JpF6P_STQGp-FOvDpn6Yw@mail.gmail.com>
<81d9d421-6947-7111-a1dc-cfd99cd3ae53@geomaster.pt>
<23215.1560977098@sss.pgh.pa.us>
<20190620031218.GC2660@paquier.xyz>
<20190620070319.GH2660@paquier.xyz>
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
Attachments:
[image/png] cropped-geomaster300x300-1.png (33.1K, ../0a9fcd30-5ae2-7e5f-ac1d-60d14a2ebb63@geomaster.pt/3-cropped-geomaster300x300-1.png)
download | view image
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: jgr@geomaster.pt, michael@paquier.xyz, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2
In-Reply-To: <0a9fcd30-5ae2-7e5f-ac1d-60d14a2ebb63@geomaster.pt>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox