Bugs in CPython 3.1.1 [wave.py]

Terry Reedy tjreedy at udel.edu
Tue Jan 12 09:48:33 CET 2010


On 1/12/2010 3:25 AM, Alf P. Steinbach wrote:
> Argh! This was really annoying! Much time wasted (one naturally thinks
> that silly error must be one's own).
>
> But, anyway:
>
> Lines:
>
> 244 nitems = (chunk.chunksize - chunk.size_read) / self._sampwidth
> 464 self._nframes = initlength / (self._nchannels * self._sampwidth)
>
> Need to use Python 3.x "//" integer division.
>
> As a workaround, at least for writing wav-files (I haven't tested
> reading), one may just set the number of frames exactly before writing
> them.
>
> That should also fix any problems with piping (avoiding file pos seek to
> patch up header).
>
> Also, the unit test should best be improved to check that updating and
> backpatching of number of frames actually works.

This is a little used module that I did not even recognize. Many of the 
library modules need more tests.

> PS: It would be nice if someone(TM) could describe here in detail how to
> properly report errors like this. Of course I'm not going to do it if it
> involves establishing Yet Another Account somewhere. But hopefully it
> doesn't?

Asking about possible bugs here is fine. The above looks like one. One 
can report at bugs.python.org. Yes, registration is needed so that you 
give a name that people can recognize and an email to receive replies 
and questions at. And to discourage spam on the tracker, which sometimes 
slips through anyway when a spam person (rather than machine) bothers to 
register.




More information about the Python-list mailing list