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: Michael Paquier <michael@paquier.xyz>
Cc: Jorge Gustavo Rocha <jgr@geomaster.pt>, pgsql-bugs@lists.postgresql.org
Date: 2019-07-25T16:13:32Z
Lists: pgsql-bugs
I wrote: > Michael Paquier <michael@paquier.xyz> writes: >> I really think that >> we should stick with the approach of only removing \r when it is >> followed by \n as we basically want to be able to counter the text >> mode of Windows when something external wrote files read by our code, >> where \n has been magically transformed to \r\n. > As I said, I'm not convinced that filtering \r only where it's actually > adjacent to \n is sufficient, even on Windows. To suppose that it is > sufficient, you'd have to assume that fgets() guarantees not to split > the \r and \n across buffer boundaries, which I doubt that it does. > (If it does do that, it would break some other assumptions we have about > whether the buffer gets filled completely.) Hearing nothing further on this, I went ahead with the patch as I had it on HEAD, and a tweaked version of your patch on the back branches. regards, tom lane
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