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 HTTP authentication behavior with unrecognized auth method #56008

Closed
ubershmekel mannequin opened this issue Apr 7, 2011 · 5 comments
Closed

urllib HTTP authentication behavior with unrecognized auth method #56008

ubershmekel mannequin opened this issue Apr 7, 2011 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ubershmekel
Copy link
Mannequin

ubershmekel mannequin commented Apr 7, 2011

BPO 11799
Nosy @jcea, @orsenthil
Files
  • urllib.auth.patch: more meaningful error in urllib.request
  • urllib.auth2.patch
  • 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 = 'https://github.com/orsenthil'
    closed_at = <Date 2011-05-11.13:20:59.777>
    created_at = <Date 2011-04-07.19:32:49.651>
    labels = ['type-bug', 'library']
    title = 'urllib HTTP authentication behavior with unrecognized auth method'
    updated_at = <Date 2011-05-11.13:20:59.776>
    user = 'https://bugs.python.org/ubershmekel'

    bugs.python.org fields:

    activity = <Date 2011-05-11.13:20:59.776>
    actor = 'orsenthil'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2011-05-11.13:20:59.777>
    closer = 'orsenthil'
    components = ['Library (Lib)']
    creation = <Date 2011-04-07.19:32:49.651>
    creator = 'ubershmekel'
    dependencies = []
    files = ['21567', '21574']
    hgrepos = []
    issue_num = 11799
    keywords = ['needs review']
    message_count = 5.0
    messages = ['133248', '133263', '133288', '133289', '135774']
    nosy_count = 4.0
    nosy_names = ['jcea', 'orsenthil', 'ubershmekel', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11799'
    versions = ['Python 3.3']

    @ubershmekel
    Copy link
    Mannequin Author

    ubershmekel mannequin commented Apr 7, 2011

    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.

    @ubershmekel ubershmekel mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 7, 2011
    @ubershmekel
    Copy link
    Mannequin Author

    ubershmekel mannequin commented Apr 7, 2011

    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.

    @jcea
    Copy link
    Member

    jcea commented Apr 8, 2011

    The patch seems ok. I think this should be applied to 3.2 and 3.3. Not sure about 3.1.

    @orsenthil
    Copy link
    Member

    With the patch there is a new exception with specific msg being raised in certain cases, so this may only pertain to 3.3

    @orsenthil orsenthil self-assigned this Apr 8, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 11, 2011

    New changeset 6072db001b51 by Senthil Kumaran in branch 'default':
    Fix closes Issue bpo-11799: urllib.request Authentication Handlers will raise a
    http://hg.python.org/cpython/rev/6072db001b51

    @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 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants