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.
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.