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 mark.dickinson
Recipients mark.dickinson, thoger
Date 2010-05-10.14:44:36
SpamBayes Score 0.009896176
Marked as misclassified No
Message-id <1273502680.59.0.675628813789.issue8674@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the patch.  I agree that undefined behaviour (e.g., from signed overflow) should be avoided where at all possible.

Do you have any Python examples that failed to trigger the overflow on your platform?  If so, it would be useful to add them to Lib/test/test_audioop.py as extra testcases.

One other question:  is there something about the formats that audioop is dealing with that limits sizes to INT_MAX (rather than PY_SSIZE_T_MAX, for example)?  I'm not really familiar with audio formats.

As an aside, I also find it strange that the code raises MemoryError in these cases, since these exceptions can be raised even when there's plenty of memory available.  IMO MemoryError should only be raised as a result of a failed attempt to allocate memory from the system.  Some other exception---perhaps OverflowError---would seem more appropriate here.
History
Date User Action Args
2010-05-10 14:44:40mark.dickinsonsetrecipients: + mark.dickinson, thoger
2010-05-10 14:44:40mark.dickinsonsetmessageid: <1273502680.59.0.675628813789.issue8674@psf.upfronthosting.co.za>
2010-05-10 14:44:37mark.dickinsonlinkissue8674 messages
2010-05-10 14:44:36mark.dickinsoncreate