Issue 11799: urllib HTTP authentication behavior with unrecognized auth method (original) (raw)

Created on 2011-04-07 19:32 by ubershmekel, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib.auth.patch ubershmekel,2011-04-07 19:32 more meaningful error in urllib.request review
urllib.auth2.patch ubershmekel,2011-04-07 22:00 review
Messages (5)
msg133248 - (view) Author: Yuval Greenfield (ubershmekel) * Date: 2011-04-07 19:32
When trying to use urllib to open a page from a server with NTLM authentication python raises urllib.error.HTTPError: HTTP Error 401: Unauthorized A python 3 code example: http://codepad.org/axPomYHw This was a bit confusing for me as I had to debug urllib to figure out python doesn't support NTLM. I'd expect python to tell me the authentication method isn't supported in such cases. I didn't add a test for the attached patch as it doesn't seem test-worthy.
msg133263 - (view) Author: Yuval Greenfield (ubershmekel) * Date: 2011-04-07 22:00
I noticed it's not only that python doesn't support NTLM, it's that I used Basic Auth which isn't NTLM. So I modified the patch to pertain to basic auth and digest as well.
msg133288 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2011-04-08 03:19
The patch seems ok. I think this should be applied to 3.2 and 3.3. Not sure about 3.1.
msg133289 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-04-08 03:25
With the patch there is a new exception with specific msg being raised in certain cases, so this may only pertain to 3.3
msg135774 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-11 13:18
New changeset 6072db001b51 by Senthil Kumaran in branch 'default': Fix closes Issue #11799: urllib.request Authentication Handlers will raise a http://hg.python.org/cpython/rev/6072db001b51
History
Date User Action Args
2022-04-11 14:57:15 admin set github: 56008
2011-05-11 13:20:59 orsenthil set status: open -> closedresolution: fixedstage: resolved
2011-05-11 13🔞13 python-dev set nosy: + python-devmessages: +
2011-04-08 03:25:26 orsenthil set versions: - Python 3.2nosy: + orsenthilmessages: + assignee: orsenthil
2011-04-08 03:19:54 jcea set versions: + Python 3.2, Python 3.3, - Python 3.4nosy: + jceamessages: + keywords: + needs review, - patch
2011-04-07 22:00:08 ubershmekel set files: + urllib.auth2.patchmessages: +
2011-04-07 19:32:49 ubershmekel create