gesture: fix StringIO for PY2 (io.StringIO accept only unicode while cStringIO and StringIO accept str.) closes #1416