Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Side by Side Diff: Doc/library/urllib.request.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/tempfile.rst ('k') | Doc/library/warnings.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`urllib.request` --- Extensible library for opening URLs 1 :mod:`urllib.request` --- Extensible library for opening URLs
2 ============================================================= 2 =============================================================
3 3
4 .. module:: urllib.request 4 .. module:: urllib.request
5 :synopsis: Next generation URL opening library. 5 :synopsis: Next generation URL opening library.
6 .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu> 6 .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu>
7 .. sectionauthor:: Moshe Zadka <moshez@users.sourceforge.net> 7 .. sectionauthor:: Moshe Zadka <moshez@users.sourceforge.net>
8 8
9 9
10 The :mod:`urllib.request` module defines functions and classes which help in 10 The :mod:`urllib.request` module defines functions and classes which help in
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 will be in front of the *handler*\s, unless the *handler*\s contain them, 98 will be in front of the *handler*\s, unless the *handler*\s contain them,
99 instances of them or subclasses of them: :class:`ProxyHandler`, 99 instances of them or subclasses of them: :class:`ProxyHandler`,
100 :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandle r`, 100 :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandle r`,
101 :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, 101 :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`,
102 :class:`HTTPErrorProcessor`. 102 :class:`HTTPErrorProcessor`.
103 103
104 If the Python installation has SSL support (i.e., if the :mod:`ssl` module 104 If the Python installation has SSL support (i.e., if the :mod:`ssl` module
105 can be imported), :class:`HTTPSHandler` will also be added. 105 can be imported), :class:`HTTPSHandler` will also be added.
106 106
107 A :class:`BaseHandler` subclass may also change its :attr:`handler_order` 107 A :class:`BaseHandler` subclass may also change its :attr:`handler_order`
108 attribute to modify its position in the handlers list. 108 member variable to modify its position in the handlers list.
109 109
110 110
111 .. function:: pathname2url(path) 111 .. function:: pathname2url(path)
112 112
113 Convert the pathname *path* from the local syntax for a path to the form used in 113 Convert the pathname *path* from the local syntax for a path to the form used in
114 the path component of a URL. This does not produce a complete URL. The retu rn 114 the path component of a URL. This does not produce a complete URL. The retu rn
115 value will already be quoted using the :func:`quote` function. 115 value will already be quoted using the :func:`quote` function.
116 116
117 117
118 .. function:: url2pathname(path) 118 .. function:: url2pathname(path)
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 315
316 .. class:: CacheFTPHandler() 316 .. class:: CacheFTPHandler()
317 317
318 Open FTP URLs, keeping a cache of open FTP connections to minimize delays. 318 Open FTP URLs, keeping a cache of open FTP connections to minimize delays.
319 319
320 320
321 .. class:: UnknownHandler() 321 .. class:: UnknownHandler()
322 322
323 A catch-all class to handle unknown URLs. 323 A catch-all class to handle unknown URLs.
324
325
326 .. class:: HTTPErrorProcessor()
327
328 Process HTTP error responses.
329 324
330 325
331 .. _request-objects: 326 .. _request-objects:
332 327
333 Request Objects 328 Request Objects
334 --------------- 329 ---------------
335 330
336 The following methods describe :class:`Request`'s public interface, 331 The following methods describe :class:`Request`'s public interface,
337 and so all may be overridden in subclasses. It also defines several 332 and so all may be overridden in subclasses. It also defines several
338 public attributes that can be used by clients to inspect the parsed 333 public attributes that can be used by clients to inspect the parsed
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 539
545 .. method:: BaseHandler.add_parent(director) 540 .. method:: BaseHandler.add_parent(director)
546 541
547 Add a director as parent. 542 Add a director as parent.
548 543
549 544
550 .. method:: BaseHandler.close() 545 .. method:: BaseHandler.close()
551 546
552 Remove any parents. 547 Remove any parents.
553 548
554 The following attribute and methods should only be used by classes derived from 549 The following members and methods should only be used by classes derived from
555 :class:`BaseHandler`. 550 :class:`BaseHandler`.
556 551
557 .. note:: 552 .. note::
558 553
559 The convention has been adopted that subclasses defining 554 The convention has been adopted that subclasses defining
560 :meth:`protocol_request` or :meth:`protocol_response` methods are named 555 :meth:`protocol_request` or :meth:`protocol_response` methods are named
561 :class:`\*Processor`; all others are named :class:`\*Handler`. 556 :class:`\*Processor`; all others are named :class:`\*Handler`.
562 557
563 558
564 .. attribute:: BaseHandler.parent 559 .. attribute:: BaseHandler.parent
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 .. method:: UnknownHandler.unknown_open() 919 .. method:: UnknownHandler.unknown_open()
925 920
926 Raise a :exc:`URLError` exception. 921 Raise a :exc:`URLError` exception.
927 922
928 923
929 .. _http-error-processor-objects: 924 .. _http-error-processor-objects:
930 925
931 HTTPErrorProcessor Objects 926 HTTPErrorProcessor Objects
932 -------------------------- 927 --------------------------
933 928
934 .. method:: HTTPErrorProcessor.http_response() 929 .. method:: HTTPErrorProcessor.unknown_open()
935 930
936 Process HTTP error responses. 931 Process HTTP error responses.
937 932
938 For 200 error codes, the response object is returned immediately. 933 For 200 error codes, the response object is returned immediately.
939 934
940 For non-200 error codes, this simply passes the job on to the 935 For non-200 error codes, this simply passes the job on to the
941 :meth:`protocol_error_code` handler methods, via :meth:`OpenerDirector.error` . 936 :meth:`protocol_error_code` handler methods, via :meth:`OpenerDirector.error` .
942 Eventually, :class:`HTTPDefaultErrorHandler` will raise an 937 Eventually, :class:`HTTPDefaultErrorHandler` will raise an
943 :exc:`HTTPError` if no other handler handles the error. 938 :exc:`HTTPError` if no other handler handles the error.
944
945
946 .. method:: HTTPErrorProcessor.https_response()
947
948 Process HTTPS error responses.
949
950 The behavior is same as :meth:`http_response`.
951 939
952 940
953 .. _urllib-request-examples: 941 .. _urllib-request-examples:
954 942
955 Examples 943 Examples
956 -------- 944 --------
957 945
958 This example gets the python.org main page and displays the first 300 bytes of 946 This example gets the python.org main page and displays the first 300 bytes of
959 it. :: 947 it. ::
960 948
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 .. module:: urllib.response 1307 .. module:: urllib.response
1320 :synopsis: Response classes used by urllib. 1308 :synopsis: Response classes used by urllib.
1321 1309
1322 The :mod:`urllib.response` module defines functions and classes which define a 1310 The :mod:`urllib.response` module defines functions and classes which define a
1323 minimal file like interface, including ``read()`` and ``readline()``. The 1311 minimal file like interface, including ``read()`` and ``readline()``. The
1324 typical response object is an addinfourl instance, which defines an ``info()`` 1312 typical response object is an addinfourl instance, which defines an ``info()``
1325 method and that returns headers and a ``geturl()`` method that returns the url. 1313 method and that returns headers and a ``geturl()`` method that returns the url.
1326 Functions defined by this module are used internally by the 1314 Functions defined by this module are used internally by the
1327 :mod:`urllib.request` module. 1315 :mod:`urllib.request` module.
1328 1316
OLDNEW
« no previous file with comments | « Doc/library/tempfile.rst ('k') | Doc/library/warnings.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+