py3 fix for HTML escaping