mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Use binary mode to open "wave" files.
This commit is contained in:
parent
5db5ba1ee3
commit
70f128861f
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ nframes = 100
|
|||
|
||||
testfile = tempfile.mktemp()
|
||||
|
||||
f = wave.open(testfile, 'w')
|
||||
f = wave.open(testfile, 'wb')
|
||||
f.setnchannels(nchannels)
|
||||
f.setsampwidth(sampwidth)
|
||||
f.setframerate(framerate)
|
||||
|
@ -22,7 +22,7 @@ output = '\0' * nframes * nchannels * sampwidth
|
|||
f.writeframes(output)
|
||||
f.close()
|
||||
|
||||
f = wave.open(testfile, 'r')
|
||||
f = wave.open(testfile, 'rb')
|
||||
check(nchannels == f.getnchannels(), "nchannels")
|
||||
check(sampwidth == f.getsampwidth(), "sampwidth")
|
||||
check(framerate == f.getframerate(), "framerate")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue