1. Luke Plant
  2. sphinx


Sebastian Wiesner  committed 0957d57

#122: proxy support for intersphinx

  • Participants
  • Parent commits cd18cd4
  • Branches default

Comments (0)

Files changed (2)

File doc/ext/intersphinx.rst

View file
  • Ignore whitespace
    ``http://docs.python.org/dev``.  It is up to you to update the inventory file
    as new objects are added to the Python documentation.
+   When fetching remote inventory files, proxy settings will be read from
+   the ``$HTTP_PROXY`` environment variable.
 .. confval:: intersphinx_cache_limit
    The maximum number of days to cache remote inventories.  The default is

File sphinx/ext/intersphinx.py

View file
  • Ignore whitespace
 import time
-import urllib
+import urllib2
 import posixpath
 from os import path
 from sphinx.builders.html import INVENTORY_FILENAME
+    urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
+    urllib2.HTTPHandler(), urllib2.HTTPSHandler()))
 def fetch_inventory(app, uri, inv):
     """Fetch, parse and return an intersphinx inventory file."""
     invdata = {}
     localuri = uri.find('://') == -1
         if inv.find('://') != -1:
-            f = urllib.urlopen(inv)
+            f = urllib2.urlopen(inv)
             f = open(path.join(app.srcdir, inv))
     except Exception, err: