Use io module instead of file.
Use bytes literals instead of string literals.