Mercurial > cpython-lru_cache-weakref
view Doc/lib/libgopherlib.tex @ 25135:0f0016632be4 legacy-trunk
_formatparam(), set_param(): RFC 2231 encoding support by Oleg
Broytmann in SF patch #600096. Specifically, the former function now
encodes the triplets, while the latter adds optional charset and
language arguments.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Fri, 06 Sep 2002 03:55:04 +0000 |
| parents | 85cf476657c5 |
| children | f4a01c405a44 |
line wrap: on
line source
\section{\module{gopherlib} --- Gopher protocol client} \declaremodule{standard}{gopherlib} \modulesynopsis{Gopher protocol client (requires sockets).} \indexii{Gopher}{protocol} This module provides a minimal implementation of client side of the the Gopher protocol. It is used by the module \refmodule{urllib} to handle URLs that use the Gopher protocol. The module defines the following functions: \begin{funcdesc}{send_selector}{selector, host\optional{, port}} Send a \var{selector} string to the gopher server at \var{host} and \var{port} (default \code{70}). Returns an open file object from which the returned document can be read. \end{funcdesc} \begin{funcdesc}{send_query}{selector, query, host\optional{, port}} Send a \var{selector} string and a \var{query} string to a gopher server at \var{host} and \var{port} (default \code{70}). Returns an open file object from which the returned document can be read. \end{funcdesc} Note that the data returned by the Gopher server can be of any type, depending on the first character of the selector string. If the data is text (first character of the selector is \samp{0}), lines are terminated by CRLF, and the data is terminated by a line consisting of a single \samp{.}, and a leading \samp{.} should be stripped from lines that begin with \samp{..}. Directory listings (first character of the selector is \samp{1}) are transferred using the same protocol.
