When writing from files in Python 2 and 3, we get a str.
Make event optional when writing commands from a file.