[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Maposmatic-dev] Possible file descriptor leak when reading logo fil
From: |
Maxime Petazzoni |
Subject: |
Re: [Maposmatic-dev] Possible file descriptor leak when reading logo file |
Date: |
Sat, 14 Apr 2012 10:05:49 -0700 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
* David MENTRE <address@hidden> [2012-04-14 18:49:30]:
> Hello,
>
> I think we have a file descriptor leak when importing the logo file:
> the logo file descriptor is not closed. I think I fixed this properly,
> but any review from a Python expert would be appreciated. :-)
You don't need this here because of the with statement, which will
always call f.__exit__() (which calls f.close()) even if the with block
throws an exception.
/Max
--
Maxime Petazzoni <http://www.bulix.org>
``One by one, the penguins took away my sanity.''
Writing software in California
signature.asc
Description: Digital signature