Skip to content

Commit 26de888

Browse files
committed
address review
1 parent 62441ac commit 26de888

2 files changed

Lines changed: 42 additions & 45 deletions

File tree

Doc/library/urllib.parse.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ or on combining URL components into a URL string.
125125

126126
If the *allow_fragments* argument is false, fragment identifiers are not
127127
recognized. Instead, they are parsed as part of the path
128-
or query component, and :attr:`fragment <SplitResult.fragment>` is set to
128+
or query component, and :attr:`~SplitResult.fragment` is set to
129129
``None`` or the empty
130130
string (depending on the value of *missing_as_none*) in the return value.
131131

@@ -158,16 +158,16 @@ or on combining URL components into a URL string.
158158

159159
.. [1] Depending on the value of the *missing_as_none* argument.
160160
161-
Reading the :attr:`port <SplitResult.port>` attribute will raise a
161+
Reading the :attr:`~SplitResult.port` attribute will raise a
162162
:exc:`ValueError` if
163163
an invalid port is specified in the URL. See section
164164
:ref:`urlparse-result-object` for more information on the result object.
165165

166-
Unmatched square brackets in the :attr:`netloc <SplitResult.netloc>`
166+
Unmatched square brackets in the :attr:`~SplitResult.netloc`
167167
attribute will raise a
168168
:exc:`ValueError`.
169169

170-
Characters in the :attr:`netloc <SplitResult.netloc>` attribute that
170+
Characters in the :attr:`~SplitResult.netloc` attribute that
171171
decompose under NFKC
172172
normalization (as used by the IDNA encoding) into any of ``/``, ``?``,
173173
``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is
@@ -512,15 +512,15 @@ byte values will trigger :exc:`UnicodeDecodeError`.
512512

513513
To support easier conversion of result objects between :class:`str` and
514514
:class:`bytes`, all return values from URL parsing functions provide
515-
either an :meth:`encode <DefragResult.encode>` method (when the result contains
516-
:class:`str` data) or a :meth:`decode <DefragResultBytes.decode>` method (when
515+
either an :meth:`~DefragResult.encode` method (when the result contains
516+
:class:`str` data) or a :meth:`~DefragResultBytes.decode` method (when
517517
the result contains :class:`bytes`
518518
data). The signatures of these methods match those of the corresponding
519519
:class:`str` and :class:`bytes` methods (except that the default encoding
520520
is ``'ascii'`` rather than ``'utf-8'``). Each produces a value of a
521521
corresponding type that contains either :class:`bytes` data (for
522-
:meth:`encode <DefragResult.encode>` methods) or :class:`str` data (for
523-
:meth:`decode <DefragResultBytes.decode>` methods).
522+
:meth:`~DefragResult.encode` methods) or :class:`str` data (for
523+
:meth:`~DefragResultBytes.decode` methods).
524524

525525
Applications that need to operate on potentially improperly quoted URLs
526526
that may contain non-ASCII data will need to do their own decoding from
@@ -546,17 +546,17 @@ These subclasses add the attributes listed in the documentation for
546546
those functions, the encoding and decoding support described in the
547547
previous section, as well as additional methods:
548548

549-
.. |split-scheme| replace:: :attr:`scheme <SplitResult.scheme>`
550-
.. |split-netloc| replace:: :attr:`netloc <SplitResult.netloc>`
551-
.. |split-path| replace:: :attr:`path <SplitResult.path>`
552-
.. |split-query| replace:: :attr:`query <SplitResult.query>`
553-
.. |split-frag| replace:: :attr:`fragment <SplitResult.fragment>`
554-
.. |split-username| replace:: :attr:`username <SplitResult.username>`
555-
.. |split-password| replace:: :attr:`password <SplitResult.password>`
556-
.. |split-hostname| replace:: :attr:`hostname <SplitResult.hostname>`
557-
.. |split-port| replace:: :attr:`port <SplitResult.port>`
558-
.. |defrag-url| replace:: :attr:`url <DefragResult.url>`
559-
.. |defrag-frag| replace:: :attr:`fragment <DefragResult.fragment>`
549+
.. |split-scheme| replace:: :attr:`~SplitResult.scheme`
550+
.. |split-netloc| replace:: :attr:`~SplitResult.netloc`
551+
.. |split-path| replace:: :attr:`~SplitResult.path`
552+
.. |split-query| replace:: :attr:`~SplitResult.query`
553+
.. |split-frag| replace:: :attr:`~SplitResult.fragment`
554+
.. |split-username| replace:: :attr:`~SplitResult.username`
555+
.. |split-password| replace:: :attr:`~SplitResult.password`
556+
.. |split-hostname| replace:: :attr:`~SplitResult.hostname`
557+
.. |split-port| replace:: :attr:`~SplitResult.port`
558+
.. |defrag-url| replace:: :attr:`~DefragResult.url`
559+
.. |defrag-frag| replace:: :attr:`~DefragResult.fragment`
560560

561561
.. method:: SplitResult._replace(**kwargs)
562562

Doc/library/urllib.request.rst

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,10 @@ The following classes are provided:
361361

362362
.. envvar:: no_proxy
363363

364-
A comma-separated list of hostname suffixes, optionally with ``:port``
365-
appended, which shouldn't be reached via proxy.
366-
367-
The :envvar:`no_proxy` environment variable can be used to specify hosts
368-
which shouldn't be reached via proxy; if set, it should be a comma-separated
369-
list of hostname suffixes, optionally with ``:port`` appended, for example
370-
``cern.ch,ncsa.uiuc.edu,some.host:8080``.
364+
This variable can be used to specify hosts which shouldn't be reached via
365+
proxy; if set, it should be a comma-separated list of hostname suffixes,
366+
optionally with ``:port`` appended, for example
367+
``cern.ch,ncsa.uiuc.edu,some.host:8080``.
371368

372369
.. note::
373370

@@ -673,38 +670,38 @@ OpenerDirector Objects
673670
*handler* should be an instance of :class:`BaseHandler`. The following methods
674671
are searched, and added to the possible chains (note that HTTP errors are a
675672
special case). Note that, in the following, *protocol* should be replaced
676-
with the actual protocol to handle, for example ``http_response`` would be
677-
the :ref:`protocol response handler <protocol_response>`. Also *type*
678-
should be replaced with the actual HTTP code, for example
679-
``http_error_404`` would handle HTTP 404 errors as described by the
680-
:ref:`HTTP error handler pattern <http_error_nnn>`.
673+
with the actual protocol to handle, for example :meth:`!http_response` would
674+
be the HTTP protocol response handler. Also *type* should be replaced with
675+
the actual HTTP code, for example :meth:`!http_error_404` would handle HTTP
676+
404 errors.
681677

682-
* ``<protocol>_open`` --- signal that the handler knows how to open
683-
*protocol* URLs.
678+
* :meth:`!<protocol>_open` --- signal that the handler knows how to open *protocol*
679+
URLs.
684680

685-
See :ref:`the protocol open method pattern <protocol_open>` for more
686-
information.
681+
See |protocol_open|_ for more information.
687682

688-
* ``http_error_<type>`` --- signal that the handler knows how to handle HTTP
683+
* :meth:`!http_error_\<type\>` --- signal that the handler knows how to handle HTTP
689684
errors with HTTP error code *type*.
690685

691-
See :ref:`the HTTP error handler pattern <http_error_nnn>` for more
692-
information.
686+
See |http_error_nnn|_ for more information.
693687

694-
* ``<protocol>_error`` --- signal that the handler knows how to handle errors
688+
* :meth:`!<protocol>_error` --- signal that the handler knows how to handle errors
695689
from (non-\ ``http``) *protocol*.
696690

697-
* ``<protocol>_request`` --- signal that the handler knows how to pre-process
691+
* :meth:`!<protocol>_request` --- signal that the handler knows how to pre-process
698692
*protocol* requests.
699693

700-
See :ref:`the protocol request method pattern <protocol_request>` for more
701-
information.
694+
See |protocol_request|_ for more information.
702695

703-
* ``<protocol>_response`` --- signal that the handler knows how to
696+
* :meth:`!<protocol>_response` --- signal that the handler knows how to
704697
post-process *protocol* responses.
705698

706-
See :ref:`the protocol response method pattern <protocol_response>` for
707-
more information.
699+
See |protocol_response|_ for more information.
700+
701+
.. |protocol_open| replace:: :meth:`!BaseHandler.<protocol>_open`
702+
.. |http_error_nnn| replace:: :meth:`!BaseHandler.http_error_\<nnn\>`
703+
.. |protocol_request| replace:: :meth:`!BaseHandler.<protocol>_request`
704+
.. |protocol_response| replace:: :meth:`!BaseHandler.<protocol>_response`
708705

709706
.. method:: OpenerDirector.open(url, data=None[, timeout])
710707

0 commit comments

Comments
 (0)