Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1fd2e24c
Commit
1fd2e24c
authored
Apr 04, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The rest of the documentation for manual proxy configuration for a basic
urlopen(). This is part of SF patch #523415.
parent
0fc95568
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
Doc/lib/liburllib.tex
Doc/lib/liburllib.tex
+20
-3
No files found.
Doc/lib/liburllib.tex
View file @
1fd2e24c
...
...
@@ -18,7 +18,7 @@ operations are available.
It defines the following public functions:
\begin{funcdesc}
{
urlopen
}{
url
\optional
{
, data
}}
\begin{funcdesc}
{
urlopen
}{
url
\optional
{
, data
\optional
{
, proxies
}
}}
Open a network object denoted by a URL for reading. If the URL does
not have a scheme identifier, or if it has
\file
{
file:
}
as its scheme
identifier, this opens a local file; otherwise it opens a socket to a
...
...
@@ -84,6 +84,23 @@ section.
In a Macintosh environment,
\function
{
urlopen()
}
will retrieve proxy
information from Internet
\index
{
Internet Config
}
Config.
Alternatively, the optional
\var
{
proxies
}
argument may be used to
explicitly specify proxies. It must be a dictionary mapping scheme
names to proxy URLs, where an empty dictionary causes no proxies to be
used, and
\code
{
None
}
(the default value) causes environmental proxy
settings to be used as discussed above. For example:
\begin{verbatim}
# Use http://www.someproxy.com:3128 for http proxying
proxies = proxies=
{
'http': 'http://www.someproxy.com:3128'
}
filehandle = urllib.urlopen(some
_
url, proxies=proxies)
# Don't use any proxies
filehandle = urllib.urlopen(some
_
url, proxies=
{}
)
# Use proxies from environment - both versions are equivalent
filehandle = urllib.urlopen(some
_
url, proxies=None)
filehandle = urllib.urlopen(some
_
url)
\end{verbatim}
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
}
.
...
...
@@ -205,7 +222,7 @@ attribute \member{version} to an appropriate string value before the
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
off completely. Its default value is
\code
{
None
}
, in which case
environmental proxy settings will be used if present, as discussed in
the definition of
\function
{
urlopen()
}
, above.
...
...
@@ -314,7 +331,7 @@ Overridable interface to open unknown URL types.
Retrieves the contents of
\var
{
url
}
and places it in
\var
{
filename
}
. The
return value is a tuple consisting of a local filename and either a
\class
{
mimetools.Message
}
object containing the response headers (for remote
URLs) or
None
(for local URLs). The caller must then open and read the
URLs) or
\code
{
None
}
(for local URLs). The caller must then open and read the
contents of
\var
{
filename
}
. If
\var
{
filename
}
is not given and the URL
refers to a local file, the input filename is returned. If the URL is
non-local and
\var
{
filename
}
is not given, the filename is the output of
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment