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

urllib2 doesn't respect "no_proxy" environment (python2.6.2) #51143

Closed
xelnor mannequin opened this issue Sep 12, 2009 · 4 comments
Closed

urllib2 doesn't respect "no_proxy" environment (python2.6.2) #51143

xelnor mannequin opened this issue Sep 12, 2009 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@xelnor
Copy link
Mannequin

xelnor mannequin commented Sep 12, 2009

BPO 6894
Nosy @orsenthil
Files
  • python2.6.2-urllib2-no_proxy.patch: Patch for urllib2, enabling support for the "no_proxy" environment var
  • 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 2009-10-11.06:08:53.696>
    created_at = <Date 2009-09-12.10:12:27.763>
    labels = ['type-bug', 'library']
    title = 'urllib2 doesn\'t respect "no_proxy" environment  (python2.6.2)'
    updated_at = <Date 2009-10-11.06:08:53.620>
    user = 'https://bugs.python.org/xelnor'

    bugs.python.org fields:

    activity = <Date 2009-10-11.06:08:53.620>
    actor = 'orsenthil'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2009-10-11.06:08:53.696>
    closer = 'orsenthil'
    components = ['Library (Lib)']
    creation = <Date 2009-09-12.10:12:27.763>
    creator = 'xelnor'
    dependencies = []
    files = ['14880']
    hgrepos = []
    issue_num = 6894
    keywords = ['patch']
    message_count = 4.0
    messages = ['92538', '93848', '93849', '93850']
    nosy_count = 3.0
    nosy_names = ['orsenthil', 'Arfrever', 'xelnor']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6894'
    versions = ['Python 2.6', 'Python 3.1', 'Python 2.7', 'Python 3.2']

    @xelnor
    Copy link
    Mannequin Author

    xelnor mannequin commented Sep 12, 2009

    I discovered recently that urllib2 doesn't respect the "no_proxy"
    environment variable on linux (and on other platforms too, I think).

    Here is an example of the problem :

    • Set http_proxy and no_proxy environment variables (for instance
      no_proxy="localhost")
    proxy_handler = urllib2.ProxyHandler()
    opener = urllib2.build_opener(proxy_handler)
    urllib2.install_opener(opener)

    and then open an "outside" url : everything is OK (urllib2 reads
    correctly http_proxy), but for "localhost", it tries to open it
    through the proxy.

    You would expect urllib2 to understand no_proxy, all the more since
    all the needed code is already available in urllib.

    I have prepared a patch for urllib2 which does correct that bug.

    I don't have other versions of python installed, so I couldn't check
    that se bug is still present there.

    @xelnor xelnor mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 12, 2009
    @orsenthil orsenthil self-assigned this Oct 7, 2009
    @orsenthil
    Copy link
    Member

    Fixed in trunk and Committed revision 75333.

    @orsenthil
    Copy link
    Member

    merged into py3k revision 75334
    merged into release-26maint revision 75335.

    @orsenthil
    Copy link
    Member

    merged in release31-maint in revision 75336

    Closing the issue.

    @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

    1 participant