replace soon-to-be-deprecated codecs.open() with open()