Fix authentication with Python 3 (Issue #153)