Use StringIO instead of io module for 2.5 compat