hwrt/create_pfiles.py: Try to fix 'TypeError: must be unicode, not str' for Python 2.7