fix auth urllib error after python 3 migration