Menu

#1 Class does not close the file.

open
nobody
None
5
2005-07-26
2005-07-26
fabworld
No

After passing the name of a file to the ID3 object, I
was unable to rename the passed file as it was still
opened by the ID3 object.

I could pass a file object instead, but would prefer to
pass the filename.

I added the following as the last line of __init__
self.file.close()

Which solved the specific problem.
Potential problems could still exists, if an exception
occured, as the function would return at a different point.

Using python 2.4.1 on XP.

Discussion


Log in to post a comment.