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.


Freeipa-devel mailing list

Reply via email to