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
124a4e58
Commit
124a4e58
authored
Feb 20, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #947571: By default, urllib.urlopen() does not raise IOErrors
on server error codes. Make this clear.
parent
a223d2cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
Doc/lib/liburllib.tex
Doc/lib/liburllib.tex
+8
-1
No files found.
Doc/lib/liburllib.tex
View file @
124a4e58
...
@@ -23,7 +23,7 @@ Open a network object denoted by a URL for reading. If the URL does
...
@@ -23,7 +23,7 @@ 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
not have a scheme identifier, or if it has
\file
{
file:
}
as its scheme
identifier, this opens a local file (without universal newlines);
identifier, this opens a local file (without universal newlines);
otherwise it opens a socket to a server somewhere on the network. If
otherwise it opens a socket to a server somewhere on the network. If
the connection cannot be made
, or if the server returns an error code,
the connection cannot be made
the
\exception
{
IOError
}
exception is raised. If all went well, a
the
\exception
{
IOError
}
exception is raised. If all went well, a
file-like object is returned. This supports the following methods:
file-like object is returned. This supports the following methods:
\method
{
read()
}
,
\method
{
readline()
}
,
\method
{
readlines()
}
,
\method
{
fileno()
}
,
\method
{
read()
}
,
\method
{
readline()
}
,
\method
{
readlines()
}
,
\method
{
fileno()
}
,
...
@@ -274,6 +274,9 @@ Additional keyword parameters, collected in \var{x509}, are used for
...
@@ -274,6 +274,9 @@ Additional keyword parameters, collected in \var{x509}, are used for
authentication with the
\file
{
https:
}
scheme. The keywords
authentication with the
\file
{
https:
}
scheme. The keywords
\var
{
key
_
file
}
and
\var
{
cert
_
file
}
are supported; both are needed to
\var
{
key
_
file
}
and
\var
{
cert
_
file
}
are supported; both are needed to
actually retrieve a resource at an
\file
{
https:
}
URL.
actually retrieve a resource at an
\file
{
https:
}
URL.
\class
{
URLopener
}
objects will raise an
\exception
{
IOError
}
exception
if the server returns an error code.
\end{classdesc}
\end{classdesc}
\begin{classdesc}
{
FancyURLopener
}{
...
}
\begin{classdesc}
{
FancyURLopener
}{
...
}
...
@@ -285,6 +288,10 @@ response codes (authentication required), basic HTTP authentication is
...
@@ -285,6 +288,10 @@ response codes (authentication required), basic HTTP authentication is
performed. For the 30x response codes, recursion is bounded by the
performed. For the 30x response codes, recursion is bounded by the
value of the
\var
{
maxtries
}
attribute, which defaults to 10.
value of the
\var
{
maxtries
}
attribute, which defaults to 10.
For all other response codes, the method
\method
{
http
_
error
_
default()
}
is called which you can override in subclasses to handle the error
appropriately.
\note
{
According to the letter of
\rfc
{
2616
}
, 301 and 302 responses to
\note
{
According to the letter of
\rfc
{
2616
}
, 301 and 302 responses to
POST requests must not be automatically redirected without
POST requests must not be automatically redirected without
confirmation by the user. In reality, browsers do allow automatic
confirmation by the user. In reality, browsers do allow automatic
...
...
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