I think this will leave a permanently open "file" around.  We could probably work around that using a context manager, but I'm not sure how to do that while keeping the code consistent with the py3 version.  For now, let's leave this as is, but think about ways to keep the file handler closed in general