fix Python3 io issue