Restoring attributes compatibility with unicode strings in Python 2.x