You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "C:\Documents and Settings\Alf\sound\error.py", line 6, in <module>
writer.setframerate( framerate )
NameError: name 'framerate' is not defined
Exception wave.Error: Error('sampling rate not specified',) in <bound method Wave_write.__del__ of <wave.Wave_write obje
ct at 0x00FE87F0>> ignored
TO FIX:
"/" needs to be changed to "//" in lines and 243 464 of [wave.py]
Traceback (most recent call last):
File "C:\Documents and Settings\Alf\sound\error.py", line 8, in <module>
writer.writeframes( b"\0"*2*4 )
File "C:\Program Files\cpython\python31\lib\wave.py", line 432, in writeframesself.writeframesraw(data)
File "C:\Program Files\cpython\python31\lib\wave.py", line 416, in writeframesrawself._ensure_header_written(len(data))
File "C:\Program Files\cpython\python31\lib\wave.py", line 459, in _ensure_header_writtenself._write_header(datasize)
File "C:\Program Files\cpython\python31\lib\wave.py", line 472, in _write_headerself._sampwidth *8, 'data'))
struct.error: required argument is not an integer
Exception struct.error: 'required argument is not an integer' in <bound method Wave_write.__del__ of <wave.Wave_write ob
ject at 0x00FE87F0>> ignored
No, sorry, the bugs in [wave.py] have nothing to do with a name IN A COMMENT in the trivial code to exercise the bugs.
To reproduce the crash, just run the supplied code with Python 3.1.1 in Windows XP.
The cause of the crash is, as I pointed out, use of Python 2.x "/" division instead of Python 3.x "//" division. The author of [wave.py] had fixed that in some places. But he/she forgot two places.
Activity
alfps commentedon Jan 12, 2010
CPython 3.1.1 in Windows XP.
TO FIX:
"/" needs to be changed to "//" in lines and 243 464 of [wave.py]
alfps commentedon Jan 12, 2010
Sorry, here's correct error message:
briancurtin commentedon Jan 12, 2010
In your example, the "n_frames" name does not exist, which is causing the problem. In your first comment, "framerate" also did not exist.
I don't know what a proper frame rate value is, but I just put 10 in there and it worked fine. Can you confirm?
alfps commentedon Jan 12, 2010
No, sorry, the bugs in [wave.py] have nothing to do with a name IN A COMMENT in the trivial code to exercise the bugs.
To reproduce the crash, just run the supplied code with Python 3.1.1 in Windows XP.
The cause of the crash is, as I pointed out, use of Python 2.x "/" division instead of Python 3.x "//" division. The author of [wave.py] had fixed that in some places. But he/she forgot two places.
Cheers & hth.,
briancurtin commentedon Jan 13, 2010
There is no crash, but I see what you are saying now.
Patch to correct the two divisions and a test similar to your example.
[-]Incorrect division in [wave.py] causing crash[/-][+]Incorrect division in [wave.py][/+]benjaminp commentedon Jan 13, 2010
Thanks for the patch! Applied in r77459.