Use binary mode to open "wave" files.

This commit is contained in:
Guido van Rossum 2000-12-19 06:32:57 +00:00
parent 5db5ba1ee3
commit 70f128861f

View File

@ -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")