]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport 1.7:
authorAnthony Baxter <anthonybaxter@gmail.com>
Wed, 5 Dec 2001 06:13:38 +0000 (06:13 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Wed, 5 Dec 2001 06:13:38 +0000 (06:13 +0000)
Amazing.  This would open the sound file in text mode.  Fixed.
SF bug  #446219.

Lib/sndhdr.py

index 29f0760c9e412775e2bb44fe6369f6b12cfaf043..df2ccf17ba4b99510329549bf147ac68f65e4fd4 100644 (file)
@@ -40,7 +40,7 @@ def what(filename):
 
 def whathdr(filename):
     """Recognize sound headers"""
-    f = open(filename, 'r')
+    f = open(filename, 'rb')
     h = f.read(512)
     for tf in tests:
         res = tf(h, f)