/html/library/urllib.error.html
HTML | 177 lines | 162 code | 15 blank | 0 comment | 0 complexity | 7cf5fc36fbfe2bb17a5f0856ea10a3df MD5 | raw file
Possible License(s): BSD-3-Clause
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>20.8. urllib.error — Exception classes raised by urllib.request — Documentação Python v3.1c1</title>
- <link rel="stylesheet" href="../_static/default.css" type="text/css" />
- <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../',
- VERSION: '3.1c1',
- COLLAPSE_MODINDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../_static/jquery.js"></script>
- <script type="text/javascript" src="../_static/doctools.js"></script>
- <link rel="search" type="application/opensearchdescription+xml"
- title="Search within Documentação Python v3.1c1"
- href="../_static/opensearch.xml"/>
- <link rel="author" title="About these documents" href="../about.html" />
- <link rel="copyright" title="Copyright" href="../copyright.html" />
- <link rel="top" title="Documentação Python v3.1c1" href="../index.html" />
- <link rel="up" title="20. Internet Protocols and Support" href="internet.html" />
- <link rel="next" title="20.9. urllib.robotparser — Parser for robots.txt" href="urllib.robotparser.html" />
- <link rel="prev" title="20.7. urllib.parse — Parse URLs into components" href="urllib.parse.html" />
- <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
-
- </head>
- <body>
- <div class="related">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../genindex.html" title="Índice Geral"
- accesskey="I">índice</a></li>
- <li class="right" >
- <a href="../modindex.html" title="Índice Global de Móodulos"
- accesskey="M">módulos</a> |</li>
- <li class="right" >
- <a href="urllib.robotparser.html" title="20.9. urllib.robotparser — Parser for robots.txt"
- accesskey="N">próximo</a> |</li>
- <li class="right" >
- <a href="urllib.parse.html" title="20.7. urllib.parse — Parse URLs into components"
- accesskey="P">anterior</a> |</li>
- <li><img src="../_static/py.png" alt=""
- style="vertical-align: middle; margin-top: -1px"/></li>
- <li><a href="../index.html">Documentação Python v3.1c1</a> »</li>
- <li><a href="index.html" >The Python Standard Library</a> »</li>
- <li><a href="internet.html" accesskey="U">20. Internet Protocols and Support</a> »</li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body">
-
- <div class="section" id="module-urllib.error">
- <h1>20.8. <tt class="xref docutils literal"><span class="pre">urllib.error</span></tt> — Exception classes raised by urllib.request<a class="headerlink" href="#module-urllib.error" title="Permalink to this headline">¶</a></h1>
- <p>The <tt class="xref docutils literal"><span class="pre">urllib.error</span></tt> module defines the exception classes for exceptions
- raised by <a title="Next generation URL opening library." class="reference external" href="urllib.request.html#module-urllib.request"><tt class="xref docutils literal"><span class="pre">urllib.request</span></tt></a>. The base exception class is <a title="urllib.error.URLError" class="reference internal" href="#urllib.error.URLError"><tt class="xref docutils literal"><span class="pre">URLError</span></tt></a>,
- which inherits from <a title="exceptions.IOError" class="reference external" href="exceptions.html#exceptions.IOError"><tt class="xref docutils literal"><span class="pre">IOError</span></tt></a>.</p>
- <p>The following exceptions are raised by <tt class="xref docutils literal"><span class="pre">urllib.error</span></tt> as appropriate:</p>
- <dl class="exception">
- <dt id="urllib.error.URLError">
- <em class="property">
- exception </em><tt class="descclassname">urllib.error.</tt><tt class="descname">URLError</tt><a class="headerlink" href="#urllib.error.URLError" title="Link permanente para esta definição">¶</a></dt>
- <dd><p>The handlers raise this exception (or derived exceptions) when they run into
- a problem. It is a subclass of <a title="exceptions.IOError" class="reference external" href="exceptions.html#exceptions.IOError"><tt class="xref docutils literal"><span class="pre">IOError</span></tt></a>.</p>
- <dl class="attribute">
- <dt id="urllib.error.URLError.reason">
- <tt class="descname">reason</tt><a class="headerlink" href="#urllib.error.URLError.reason" title="Link permanente para esta definição">¶</a></dt>
- <dd>The reason for this error. It can be a message string or another
- exception instance (<a title="socket.error" class="reference external" href="socket.html#socket.error"><tt class="xref docutils literal"><span class="pre">socket.error</span></tt></a> for remote URLs, <a title="exceptions.OSError" class="reference external" href="exceptions.html#exceptions.OSError"><tt class="xref docutils literal"><span class="pre">OSError</span></tt></a>
- for local URLs).</dd></dl>
- </dd></dl>
- <dl class="exception">
- <dt id="urllib.error.HTTPError">
- <em class="property">
- exception </em><tt class="descclassname">urllib.error.</tt><tt class="descname">HTTPError</tt><a class="headerlink" href="#urllib.error.HTTPError" title="Link permanente para esta definição">¶</a></dt>
- <dd><p>Though being an exception (a subclass of <a title="urllib.error.URLError" class="reference internal" href="#urllib.error.URLError"><tt class="xref docutils literal"><span class="pre">URLError</span></tt></a>), an
- <a title="urllib.error.HTTPError" class="reference internal" href="#urllib.error.HTTPError"><tt class="xref docutils literal"><span class="pre">HTTPError</span></tt></a> can also function as a non-exceptional file-like return
- value (the same thing that <tt class="xref docutils literal"><span class="pre">urlopen()</span></tt> returns). This is useful when
- handling exotic HTTP errors, such as requests for authentication.</p>
- <dl class="attribute">
- <dt id="urllib.error.HTTPError.code">
- <tt class="descname">code</tt><a class="headerlink" href="#urllib.error.HTTPError.code" title="Link permanente para esta definição">¶</a></dt>
- <dd>An HTTP status code as defined in <a class="reference external" href="http://www.faqs.org/rfcs/rfc2616.html">RFC 2616</a>. This numeric value corresponds
- to a value found in the dictionary of codes as found in
- <a title="http.server.BaseHTTPRequestHandler.responses" class="reference external" href="http.server.html#http.server.BaseHTTPRequestHandler.responses"><tt class="xref docutils literal"><span class="pre">http.server.BaseHTTPRequestHandler.responses</span></tt></a>.</dd></dl>
- </dd></dl>
- <dl class="exception">
- <dt id="urllib.error.ContentTooShortError">
- <em class="property">
- exception </em><tt class="descclassname">urllib.error.</tt><tt class="descname">ContentTooShortError</tt><big>(</big><em>msg</em><span class="optional">[</span>, <em>content</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#urllib.error.ContentTooShortError" title="Link permanente para esta definição">¶</a></dt>
- <dd>This exception is raised when the <tt class="xref docutils literal"><span class="pre">urlretrieve()</span></tt> function detects that
- the amount of the downloaded data is less than the expected amount (given by
- the <em>Content-Length</em> header). The <tt class="xref docutils literal"><span class="pre">content</span></tt> attribute stores the
- downloaded (and supposedly truncated) data.</dd></dl>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar">
- <div class="sphinxsidebarwrapper">
- <h4>Tópico anterior</h4>
- <p class="topless"><a href="urllib.parse.html"
- title="capítulo anterior">20.7. <tt class="docutils literal"><span class="pre">urllib.parse</span></tt> — Parse URLs into components</a></p>
- <h4>Próximo tópico</h4>
- <p class="topless"><a href="urllib.robotparser.html"
- title="próximo capítulo">20.9. <tt class="docutils literal docutils literal"><span class="pre">urllib.robotparser</span></tt> — Parser for robots.txt</a></p>
- <h3>Esta página</h3>
- <ul class="this-page-menu">
- <li><a href="../_sources/library/urllib.error.txt"
- rel="nofollow">Mostrar fonte</a></li>
- </ul>
- <div id="searchbox" style="display: none">
- <h3>Busca rápida</h3>
- <form class="search" action="../search.html" method="get">
- <input type="text" name="q" size="18" />
- <input type="submit" value="Ir" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Informe o termo, módulo, classe ou nome de função para buscar.
- </p>
- </div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../genindex.html" title="Índice Geral"
- >índice</a></li>
- <li class="right" >
- <a href="../modindex.html" title="Índice Global de Móodulos"
- >módulos</a> |</li>
- <li class="right" >
- <a href="urllib.robotparser.html" title="20.9. urllib.robotparser — Parser for robots.txt"
- >próximo</a> |</li>
- <li class="right" >
- <a href="urllib.parse.html" title="20.7. urllib.parse — Parse URLs into components"
- >anterior</a> |</li>
- <li><img src="../_static/py.png" alt=""
- style="vertical-align: middle; margin-top: -1px"/></li>
- <li><a href="../index.html">Documentação Python v3.1c1</a> »</li>
- <li><a href="index.html" >The Python Standard Library</a> »</li>
- <li><a href="internet.html" >20. Internet Protocols and Support</a> »</li>
- </ul>
- </div>
- <div class="footer">
- © <a href="../copyright.html">Copyright</a> 1990-2009, Python Software Foundation.
- Atualizado em Jun 28, 2009.
- Criado usando <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
- </div>
- </body>
- </html>