Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib.request.urlopen dies on non-basic/digest auth schemes #65612

Open
samwyse mannequin opened this issue May 1, 2014 · 1 comment
Open

urllib.request.urlopen dies on non-basic/digest auth schemes #65612

samwyse mannequin opened this issue May 1, 2014 · 1 comment
Labels
stdlib Python modules in the Lib dir

Comments

@samwyse
Copy link
Mannequin

samwyse mannequin commented May 1, 2014

BPO 21413
Nosy @orsenthil

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2014-05-01.23:03:33.848>
labels = ['library']
title = 'urllib.request.urlopen dies on non-basic/digest auth schemes'
updated_at = <Date 2014-05-02.18:09:58.010>
user = 'https://bugs.python.org/samwyse'

bugs.python.org fields:

activity = <Date 2014-05-02.18:09:58.010>
actor = 'ned.deily'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2014-05-01.23:03:33.848>
creator = 'samwyse'
dependencies = []
files = []
hgrepos = []
issue_num = 21413
keywords = []
message_count = 1.0
messages = ['217734']
nosy_count = 3.0
nosy_names = ['orsenthil', 'samwyse', 'cvrebert']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue21413'
versions = ['Python 3.4', 'Python 3.5']

@samwyse
Copy link
Mannequin Author

samwyse mannequin commented May 1, 2014

In Python 2.x, this opens an NTLM protected URL:
opener = urllib2.build_opener(proxy_handler, auth_NTLM, auth_digest, auth_basic)
urllib2.install_opener(opener)
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)
urllib.request.install_opener(opener)
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.

@samwyse samwyse mannequin added the stdlib Python modules in the Lib dir label May 1, 2014
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

0 participants