Issue5955: aifc's close method did not close the file it wrapped,

now it does.  This also means getfp method now returns the real fp.
This commit is contained in:
R. David Murray 2009-05-07 16:27:02 +00:00
parent 0258811125
commit 8fd522fb5f
2 changed files with 19 additions and 3 deletions

View file

@ -282,10 +282,11 @@ class Aifc_read:
self._convert = None
self._markers = []
self._soundpos = 0
self._file = Chunk(file)
if self._file.getname() != 'FORM':
self._file = file
chunk = Chunk(file)
if chunk.getname() != 'FORM':
raise Error, 'file does not start with FORM id'
formdata = self._file.read(4)
formdata = chunk.read(4)
if formdata == 'AIFF':
self._aifc = 0
elif formdata == 'AIFC':