[issue5202] wave.py cannot write wave files into a shell pipeline
report at bugs.python.org
Wed Feb 11 21:34:16 CET 2009
David Jones <drj at pobox.com> added the comment:
On 10 Feb 2009, at 21:15, David Jones wrote:
> David Jones <drj at pobox.com> added the comment:
> On 10 Feb 2009, at 16:57, Guilherme Polo wrote:
>> Guilherme Polo <ggpolo at gmail.com> added the comment:
>> Now, is there some problem if we remove the calls to the "tell"
>> in _write_header ? See patch attached (tests are very welcome too).
Ahem. Pardon me for answering you without reading your patch. I
have now read your patch and it does more than just remove the calls
to "tell". In fact it looks very fine.
It makes wave.py more like sunau.py in that it "just knows" what the
offsets into the header are. I think I like that (especially the way
you use the struct format string to compute the second offset). It
also removes that nagging question at the back of my mind: "why does
wave.py use tell when it could simply just know the offsets, which
are constant anyway?".
And it works. How cool is that? I had changed my project to use
sunau anyway, because that worked with pipes already.
Tests, you say...
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list