pgsql: Fix unaccent generation script in Windows

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix unaccent generation script in Windows
Date: 2019-09-10 21:16:21
Message-ID: E1i7nUr-0006Ul-Qm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix unaccent generation script in Windows

As originally coded, the script would fail on Windows 10 and Python 3
because stdout would not be switched to UTF-8 only for Python 2. This
patch makes that apply to both versions.

Also add python 2 compatibility markers so that we know what to remove
once we drop support for that. Also use a "with" clause to ensure file
descriptor is closed promptly.

Author: Hugh Ranalli, Ramanarayana
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/CAKm4Xs7_61XMyOWmHs3n0mmkS0O4S0pvfWk=7cQ5P0gs177f7A@mail.gmail.com
Discussion: https://postgr.es/m/15548-cef1b3f8de190d4f@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0afc0a7841889c6221fd47430e72f4fe570833f4

Modified Files
--------------
contrib/unaccent/generate_unaccent_rules.py | 44 ++++++++++++++++-------------
1 file changed, 24 insertions(+), 20 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-09-10 22:15:33 pgsql: Reduce overhead of scanning the backend[] array in LISTEN/NOTIFY
Previous Message Tom Lane 2019-09-10 16:45:52 pgsql: Sync isolationtester's handling of notice/warning messages with