Re: Unaccent extension python script Issue in Windows

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Unaccent extension python script Issue in Windows
Дата
Msg-id 20190319062517.GC2899@paquier.xyz
обсуждение исходный текст
Ответ на Re: Unaccent extension python script Issue in Windows  (Hugh Ranalli <hugh@whtc.ca>)
Ответы Re: Unaccent extension python script Issue in Windows
Список pgsql-hackers
On Mon, Mar 18, 2019 at 09:06:09AM -0400, Hugh Ranalli wrote:
> I'm not sure I'd classify the second change as "irrelevant." Using "with"
> is the standard and recommended practice for working with files in Python.

I honestly don't know about any standard way to do anythings in
Python, but it is true that using "with" saves from a forgotten
close() call.

> At the moment the script does nothing to close the open data file, whether
> through regular processing or in the case of an exception. I would argue
> that's a bug and should be fixed. Creating a separate patch for that seems
> to be adding work for no reason.

This script runs in a short-lived context, so it is really not a big
deal to not close the opened UnicodeData.txt.  I agree that it is bad
practice though, so I think it's fine to fix the problem if there is
another patch touching the same area of the code while on it.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Two pg_rewind patches (auto generate recovery conf and ensureclean shutdown)
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Problem with default partition pruning