BUG: try/except import StringIO (Python 3 compatibility)