[docs] [issue43834] Use context manager in StringIO example