[New-bugs-announce] [issue21413] urllib.request.urlopen dies on non-basic/digest auth schemes

Samwyse report at bugs.python.org
Fri May 2 01:03:33 CEST 2014

New submission from Samwyse:

In Python 2.x, this opens an NTLM protected URL:
    opener = urllib2.build_opener(proxy_handler, auth_NTLM, auth_digest, auth_basic)
    response = urllib2.urlopen(url)

In Python 3.x, this raises an error:
    opener = urllib.request.build_opener(proxy_handler, auth_NTLM, auth_digest, auth_basic)
    response = urllib.request.urlopen(url)

The error is:
ValueError: AbstractDigestAuthHandler does not support the following scheme: 'NTLM'

Removing auth_digest from the list of handlers allows the code to work.

components: Library (Lib)
messages: 217734
nosy: samwyse
priority: normal
severity: normal
status: open
title: urllib.request.urlopen dies on non-basic/digest auth schemes
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list