Use the io module to handle file IO. This gets around string/byte confusion when running with both python 2 and python 3.
NB This also changes the --filename option to expect a file which exists and return the file's path, rather than returning an open file object. Previously this object was being opened twice.
Use the
io
module to handle file IO. This gets around string/byte confusion when running with both python 2 and python 3.NB This also changes the
--filename
option to expect a file which exists and return the file's path, rather than returning an open file object. Previously this object was being opened twice.