fixed io error for python3