Switch from using codecs to the built-in open().