[Python-checkins] CVS: python/dist/src/Doc/lib liburllib.tex,1.40,1.41

Fred L. Drake fdrake@users.sourceforge.net
Thu, 04 Apr 2002 12:09:52 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv27498/lib

Modified Files:
	liburllib.tex 
Log Message:
Documentation for manual proxy configuration, by Andy Gimblett.
This closes SF patch #523415.


Index: liburllib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** liburllib.tex	20 Oct 2001 04:24:09 -0000	1.40
--- liburllib.tex	4 Apr 2002 20:09:50 -0000	1.41
***************
*** 78,84 ****
--- 78,92 ----
  \end{verbatim}
  
+ In a Windows environment, if no proxy envvironment variables are set,
+ proxy settings are obtained from the registry's Internet Settings
+ section.
+ 
  In a Macintosh environment, \function{urlopen()} will retrieve proxy
  information from Internet\index{Internet Config} Config.
  
+ The \function{urlopen()} function does not support explicit proxy
+ specification.  If you need to override environmental proxy settings,
+ use \class{URLopener}, or a subclass such as \class{FancyURLopener}.
+ 
  Proxies which require authentication for use are not currently
  supported; this is considered an implementation limitation.
***************
*** 196,199 ****
--- 204,213 ----
  \method{open()} method is called.
  
+ The optional \var{proxies} parameter should be a dictionary mapping
+ scheme names to proxy URLs, where an empty dictionary turns proxies
+ off completely.  Its default value is None, in which case
+ environmental proxy settings will be used if present, as discussed in
+ the definition of \function{urlopen()}, above.
+ 
  Additional keyword parameters, collected in \var{x509}, are used for
  authentication with the \file{https:} scheme.  The keywords
***************
*** 360,362 ****
--- 374,397 ----
  >>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
  >>> print f.read()
+ \end{verbatim}
+ 
+ The following example uses an explicitly specified HTTP proxy,
+ overriding environment settings:
+ 
+ \begin{verbatim}
+ >>> import urllib
+ >>> proxies = {'http': 'http://proxy.example.com:8080/'}
+ >>> opener = urllib.FancyURLopener(proxies)
+ >>> f = opener.open("http://www.python.org")
+ >>> f.read()
+ \end{verbatim}
+ 
+ The following example uses no proxies at all, overriding environment
+ settings:
+ 
+ \begin{verbatim}
+ >>> import urllib
+ >>> opener = urllib.FancyURLopener({})
+ >>> f = opener.open("http://www.python.org/")
+ >>> f.read()
  \end{verbatim}