Update _io.py

possible fix for python 3 writing tree