I prefer a StringIO as well for the reasons @myronmarston pointed out.