Message147550
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! |
|
Date |
User |
Action |
Args |
2011-11-13 07:34:19 | Oleg.Plakhotnyuk | set | recipients:
+ Oleg.Plakhotnyuk |
2011-11-13 07:34:19 | Oleg.Plakhotnyuk | set | messageid: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> |
2011-11-13 07:34:18 | Oleg.Plakhotnyuk | link | issue13394 messages |
2011-11-13 07:34:18 | Oleg.Plakhotnyuk | create | |
|