New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audioop: weightB not divided by GCD, weightA divided twice #68514
Comments
Hi - During a code review of Modules/audioop.c I noted that weightB is never divided by the GCD while weightA is divided twice. This is contrary to the comment and appears to be a bug:
The patch file below (hg diff) fixes this issue. |
New changeset 800a55c20b56 by Serhiy Storchaka in branch '3.4': New changeset 418ab34fd1ce by Serhiy Storchaka in branch '2.7': New changeset fc85a384b16c by Serhiy Storchaka in branch '3.5': New changeset 1acb6c88b901 by Serhiy Storchaka in branch 'default': |
Thank you for your report and patch David. |
The changed test passes on 3.4 branch, but fails on 2.7 branch: $ python2.7 -m test.test_audioop
test_add (__main__.TestAudioop) ... ok
test_adpcm2lin (__main__.TestAudioop) ... ok
test_alaw2lin (__main__.TestAudioop) ... ok
test_avg (__main__.TestAudioop) ... ok
test_avgpp (__main__.TestAudioop) ... ok
test_bias (__main__.TestAudioop) ... ok
test_cross (__main__.TestAudioop) ... ok
test_findfactor (__main__.TestAudioop) ... ok
test_findfit (__main__.TestAudioop) ... ok
test_findmax (__main__.TestAudioop) ... ok
test_getsample (__main__.TestAudioop) ... ok
test_issue7673 (__main__.TestAudioop) ... ok
test_lin2adpcm (__main__.TestAudioop) ... ok
test_lin2alaw (__main__.TestAudioop) ... ok
test_lin2lin (__main__.TestAudioop) ... ok
test_lin2ulaw (__main__.TestAudioop) ... ok
test_max (__main__.TestAudioop) ... ok
test_maxpp (__main__.TestAudioop) ... ok
test_minmax (__main__.TestAudioop) ... ok
test_mul (__main__.TestAudioop) ... ok
test_negativelen (__main__.TestAudioop) ... ok
test_ratecv (__main__.TestAudioop) ... ERROR
test_reverse (__main__.TestAudioop) ... ok
test_rms (__main__.TestAudioop) ... ok
test_tomono (__main__.TestAudioop) ... ok
test_tostereo (__main__.TestAudioop) ... ok
test_ulaw2lin (__main__.TestAudioop) ... ok
test_wrongsize (__main__.TestAudioop) ... ok ====================================================================== Traceback (most recent call last):
File "/usr/lib64/python2.7/test/test_audioop.py", line 304, in test_ratecv
3: packs[3](0, 0x0da740, 0x377776, -0x262fca,
KeyError: 3 Ran 28 tests in 0.009s FAILED (errors=1)
Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib64/python2.7/test/test_audioop.py", line 410, in <module>
test_main()
File "/usr/lib64/python2.7/test/test_audioop.py", line 407, in test_main
run_unittest(TestAudioop)
File "/usr/lib64/python2.7/test/test_support.py", line 1400, in run_unittest
_run_suite(suite)
File "/usr/lib64/python2.7/test/test_support.py", line 1383, in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
File "/usr/lib64/python2.7/test/test_audioop.py", line 304, in test_ratecv
3: packs[3](0, 0x0da740, 0x377776, -0x262fca,
KeyError: 3 |
New changeset 7d6a6028b104 by Serhiy Storchaka in branch '2.7': |
Thank you Arfrever. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: