urllib2, proxies, and pac files on OS X

Discussion in 'Python' started by Mani Ghasemlou, Mar 30, 2009.

  1. Hi all,

    urllib2 correctly detects proxies as configured in my preferences pane
    on OS X 10.5:

    Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
    [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import urllib2
    >>> urllib2.ProxyHandler().proxies

    {'http': 'http://openproxy.in.tungle.com:8080'}
    >>>


    However, when configuring a proxy via PAC file, this does not seem to
    be the case:

    Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
    [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import urllib2
    >>> urllib2.ProxyHandler().proxies

    {}
    >>>


    Is there any way to obtain (and parse using something like pacparser)
    the PAC file via urllib2 (or some other standard python library), or
    is this something I need to tackle using Cocoa (in my case PyObjC)?

    Thanks a lot!

    Mani
    Mani Ghasemlou, Mar 30, 2009
    #1
    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. Fuzzyman

    urllib2, https, and proxies

    Fuzzyman, Jun 29, 2005, in forum: Python
    Replies:
    0
    Views:
    403
    Fuzzyman
    Jun 29, 2005
  2. tomazi75-nospam(at)gmail.com

    urllib2 and proxies support ?

    tomazi75-nospam(at)gmail.com, Jan 4, 2006, in forum: Python
    Replies:
    1
    Views:
    373
  3. Replies:
    0
    Views:
    783
  4. Astan Chee

    urllib2, proxies and https

    Astan Chee, Aug 18, 2006, in forum: Python
    Replies:
    1
    Views:
    410
    John J. Lee
    Aug 20, 2006
  5. Manu Garg
    Replies:
    0
    Views:
    299
    Manu Garg
    Dec 17, 2007
Loading...

Share This Page