I'm guessing this is on Windows. Windows has an interesting property when you open a file in text mode, it stops at the first Ctrl-Z (\x1a
) character that it encounters. Any compressed file will look like a random sequence of bytes, meaning that value is bound to occur early in the file.
Open the file in binary mode:
with open('/Users/Public/Music/119-the_killers-spaceman.mp3', 'rb') as f: