mode : mode in which the file should be opened. Specify "R" for read, "W" for write, "A" for append (implies "W"), "T" for translate (text), "B" for binary.
B - Binary, блин

где Вы эту документацию читаете?
Тебе видимо надо "RB", т.е. читаем бинарник.