StringIO isn't actually used, so removing the import
Making encodings explicit again

Since the open module is being imported from io, explicit encodings will work on
Python < 3.