urllib and bypass proxy

Discussion in 'Python' started by kc, Apr 3, 2008.

  1. kc

    kc Guest

    Under MS Windows, I encountered a problem with the proxy bypass
    specification. In windows, the bypass specification for the proxy
    uses semi-colons to delimit entries. Mine happens to have two
    semi-colons back-to-back. Internet explorer handles this just fine but
    urllib equates this with ALWAYS bypass the proxy. (I'm using Python
    2.5.2)

    This is caused because the double semi-colon is turned into an empty
    string entry and at the bottom of urllib.py, and empty string can
    always be found in a host name. Therefore it always chooses to bypass
    the proxy.

    Of course the fix is to get rid of the double colon in the bypass
    settings in internet explorer (which I did). But it took me an hour to
    track this down (first time using urllib). Perhaps a better fix
    would be to test for the empty string and continue the loop in that
    case. From urllib.py:

    # now check if we match one of the registry values.
    for test in proxyOverride:
    if test == "": continue
    test = test.replace(".", r"\.") # mask dots

    This is not really a bug but rather a way to be more consistent with
    internet explorer. If this has value, do I submit a bug report or does
    someone else?
     
    kc, Apr 3, 2008
    #1
    1. Advertising

  2. On Thu, Apr 3, 2008 at 9:21 PM, kc <> wrote:

    > If this has value, do I submit a bug report or does
    > someone else?


    You do :) (http://bugs.python.org)

    --
    kv
     
    Konstantin Veretennicov, Apr 5, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    4,461
  2. Jonathan Gardner

    Asynchronous urllib (urllib+asyncore)?

    Jonathan Gardner, Feb 26, 2008, in forum: Python
    Replies:
    1
    Views:
    502
    Terry Jones
    Feb 27, 2008
  3. Replies:
    0
    Views:
    612
  4. Chris McDonald
    Replies:
    0
    Views:
    326
    Chris McDonald
    Nov 1, 2010
  5. Lars-Erik
    Replies:
    5
    Views:
    3,393
    Steven Cheng [MSFT]
    Jun 24, 2008
Loading...

Share This Page