Python 2 unicode method compatibility.