]> granicus.if.org Git - python/commitdiff
Issue #25899: Converted non-ASCII characters in docstrings and manpage
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 18 Dec 2015 11:10:37 +0000 (13:10 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 18 Dec 2015 11:10:37 +0000 (13:10 +0200)
to ASCII replacements.  Removed UTF-8 BOM from Misc/NEWS.
Original patch by Chris Angelico.

1  2 
Lib/http/client.py
Lib/urllib/request.py
Misc/NEWS

index 155c2e3ec4fe9796aae43c3906c936b00f0f21cf,80c80cf576e75d31ddc21ed79251eb8fa20c57ed..f69e7bac3b4e123d3a35614db2678e73e761278d
@@@ -721,26 -705,6 +721,26 @@@ class HTTPResponse(io.BufferedIOBase)
      # For compatibility with old-style urllib responses.
  
      def info(self):
-         a Date representing the file’s last-modified time, a
 +        '''Returns an instance of the class mimetools.Message containing
 +        meta-information associated with the URL.
 +
 +        When the method is HTTP, these headers are those returned by
 +        the server at the head of the retrieved HTML page (including
 +        Content-Length and Content-Type).
 +
 +        When the method is FTP, a Content-Length header will be
 +        present if (as is now usual) the server passed back a file
 +        length in response to the FTP retrieval request. A
 +        Content-Type header will be present if the MIME type can be
 +        guessed.
 +
 +        When the method is local-file, returned headers will include
-         containing a guess at the file’s type. See also the
++        a Date representing the file's last-modified time, a
 +        Content-Length giving file size, and a Content-Type
++        containing a guess at the file's type. See also the
 +        description of the mimetools module.
 +
 +        '''
          return self.headers
  
      def geturl(self):
index 57d0dea0753a19494ac0cb5a3dabba937e6d0143,a7fd017e1065afdb83947486316e2df45789897b..88326f81145a4640b5e765dff179be1af2caf78b
@@@ -138,66 -138,6 +138,66 @@@ __version__ = sys.version[:3
  _opener = None
  def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
              *, cafile=None, capath=None, cadefault=False, context=None):
-     * geturl() — return the URL of the resource retrieved, commonly used to
 +    '''Open the URL url, which can be either a string or a Request object.
 +
 +    *data* must be a bytes object specifying additional data to be sent to the
 +    server, or None if no such data is needed. data may also be an iterable
 +    object and in that case Content-Length value must be specified in the
 +    headers. Currently HTTP requests are the only ones that use data; the HTTP
 +    request will be a POST instead of a GET when the data parameter is
 +    provided.
 +
 +    *data* should be a buffer in the standard application/x-www-form-urlencoded
 +    format. The urllib.parse.urlencode() function takes a mapping or sequence
 +    of 2-tuples and returns an ASCII text string in this format. It should be
 +    encoded to bytes before being used as the data parameter.
 +
 +    urllib.request module uses HTTP/1.1 and includes a "Connection:close"
 +    header in its HTTP requests.
 +
 +    The optional *timeout* parameter specifies a timeout in seconds for
 +    blocking operations like the connection attempt (if not specified, the
 +    global default timeout setting will be used). This only works for HTTP,
 +    HTTPS and FTP connections.
 +
 +    If *context* is specified, it must be a ssl.SSLContext instance describing
 +    the various SSL options. See HTTPSConnection for more details.
 +
 +    The optional *cafile* and *capath* parameters specify a set of trusted CA
 +    certificates for HTTPS requests. cafile should point to a single file
 +    containing a bundle of CA certificates, whereas capath should point to a
 +    directory of hashed certificate files. More information can be found in
 +    ssl.SSLContext.load_verify_locations().
 +
 +    The *cadefault* parameter is ignored.
 +
 +    For http and https urls, this function returns a http.client.HTTPResponse
 +    object which has the following HTTPResponse Objects methods.
 +
 +    For ftp, file, and data urls and requests explicitly handled by legacy
 +    URLopener and FancyURLopener classes, this function returns a
 +    urllib.response.addinfourl object which can work as context manager and has
 +    methods such as:
 +
-     * info() — return the meta-information of the page, such as headers, in the
++    * geturl() - return the URL of the resource retrieved, commonly used to
 +      determine if a redirect was followed
 +
-     * getcode() – return the HTTP status code of the response.  Raises URLError
++    * info() - return the meta-information of the page, such as headers, in the
 +      form of an email.message_from_string() instance (see Quick Reference to
 +      HTTP Headers)
 +
++    * getcode() - return the HTTP status code of the response.  Raises URLError
 +      on errors.
 +
 +    Note that *None& may be returned if no handler handles the request (though
 +    the default installed global OpenerDirector uses UnknownHandler to ensure
 +    this never happens).
 +
 +    In addition, if proxy settings are detected (for example, when a *_proxy
 +    environment variable like http_proxy is set), ProxyHandler is default
 +    installed and makes sure the requests are handled through the proxy.
 +
 +    '''
      global _opener
      if cafile or capath or cadefault:
          if context is not None:
diff --cc Misc/NEWS
Simple merge