[Freeipa-devel] [PATCH] 0031 ipa-restore: Check if directory is provided + better errors.
Petr Viktorin
pviktori at redhat.com
Mon Nov 24 09:08:36 UTC 2014
On 11/21/2014 02:28 PM, David Kupka wrote:
> On 11/21/2014 02:12 PM, Tomas Babej wrote:
>>
>> On 11/21/2014 01:56 PM, David Kupka wrote:
[...]
>>>
>> On another note, I also noticed that read_header leaves leaking file
>> descriptor fd.
>>
>> Can you convert that part to use the with statement? This is a perfect
>> opportunity to fix this as you're touching related code.
>>
> I thought that python takes care of it.[...]
Python does take care of it eventually, but relying on this is messy – a
bit like relying on the OS to close files when the process exits.
CPython will currently close the file as soon as there are no more
references to the object, but different garbage collectors might take
much longer.
Python 3 will issue warnings when opened files are left around.
--
Petr³
More information about the Freeipa-devel
mailing list