This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Oleg.Plakhotnyuk
Recipients Oleg.Plakhotnyuk
Date 2011-11-13.07:34:16
SpamBayes Score 2.0095037e-14
Marked as misclassified No
Message-id <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za>
In-reply-to
Content
I've increased coverage of aifc.py by test_aifc.py:

before:
[1/1] test_aifc
lines   cov%   module   (path)
  560    63%   aifc   (/Users/family/Documents/code/python/repo/Lib/aifc.py)
...

after:
[1/1] test_aifc
lines   cov%   module   (path)
  561    82%   aifc   (/Users/family/Documents/code/python/repo/Lib/aifc.py)
...

I have also encountered couple of problems in aifc.py:
1. When using setmark() with string name to write to aiff file, you get Exception TypeError: "'str' does not support the buffer interface".
2. When using close() of Aifc_write object, it attempts to close it again in __del__() which ends with ValueError: write to closed file.

I propose following solutions to above problems in patch attached:
1. Use bytes type for mark names, because entire aifc library already uses bytes anyway.
2. Make file pointer check in close() and reset it after actually closing the file.

I don't think that these fixes will cause major backward compatibility problems, because with current version of aifc there is no way to write markers at all anyway.

I plan to increase test coverage of aifc.py further in subsequent patches. Just want to make it in several small steps :-)

Please provide any feedback regarding to what should I do to make this patch committed.

Thanks!
History
Date User Action Args
2011-11-13 07:34:19Oleg.Plakhotnyuksetrecipients: + Oleg.Plakhotnyuk
2011-11-13 07:34:19Oleg.Plakhotnyuksetmessageid: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za>
2011-11-13 07:34:18Oleg.Plakhotnyuklinkissue13394 messages
2011-11-13 07:34:18Oleg.Plakhotnyukcreate