allow tbtools.py to handle non-ascii files

tbtools.py crashes badly when encountering a file that is non-ascii in Python 3. This temporary fix restores functionality when encountering such a file.