Fixed name error bug in function safe_unicode in module py3compat.
Merge pull request #4132 from rossant/py3compat-bug-fix

Fixed name error bug in function safe_unicode in module py3compat.