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
urllib2 silently returns None when auth_uri is mismatched #39388
Comments
Code like the following, where the `uri' argument which import urllib2
realm = "Linksys BEFW11S4 V4"
passman = urllib2.HTTPPasswordMgr()
passman.add_password(realm,
'NOT_WHAT_THE_SERVER_GIVES_ME', 'user', 'password')
auther = urllib2.HTTPBasicAuthHandler(passman)
getter = urllib2.HTTPHandler()
director = urllib2.OpenerDirector()
director.add_handler(auther)
director.add_handler(getter)
f = director.open('http://192.168.1.1/Status.htm')
print f, "is None" |
Logged In: YES It's a doc bug. I'll add a doc patch later. Returning None from a handler means "I can't handle this, but director.add_handler(UnknownHandler) (which build_opener will do for you, actually) |
Logged In: YES Uploaded doc fix as patch 851752. |
Logged In: YES patch 851752 applied liburllib2.tex 1.20 |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: