SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 0 Python

gh-144975: Fix wave.Wave_write.setframerate() validation order (GH-144976)

Validate the frame rate after rounding to an integer, not before.
This prevents values like 0.5 from passing validation (0.5 > 0)
but then rounding to 0, which would cause a confusing delayed error
"sampling rate not specified" when writing frames.

With this fix, setframerate(0.5) immediately raises "bad frame rate",
providing clear feedback at the point of the error.
M
Michiel W. Beijen committed
ff287a72de43e7fc6517aba9049cb23470e000b2
Parent: dc24b8a
Committed by GitHub <[email protected]> on 3/17/2026, 5:01:18 PM