diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/liblogging.tex | 40 | ||||
-rw-r--r-- | Doc/lib/libsmtplib.tex | 2 | ||||
-rw-r--r-- | Doc/lib/libsocket.tex | 8 | ||||
-rw-r--r-- | Doc/lib/libtest.tex | 2 |
4 files changed, 44 insertions, 8 deletions
diff --git a/Doc/lib/liblogging.tex b/Doc/lib/liblogging.tex index b97854d..4bb0595 100644 --- a/Doc/lib/liblogging.tex +++ b/Doc/lib/liblogging.tex @@ -989,10 +989,11 @@ The \class{FileHandler} class, located in the core \module{logging} package, sends logging output to a disk file. It inherits the output functionality from \class{StreamHandler}. -\begin{classdesc}{FileHandler}{filename\optional{, mode}} +\begin{classdesc}{FileHandler}{filename\optional{, mode\optional{, encoding}}} Returns a new instance of the \class{FileHandler} class. The specified file is opened and used as the stream for logging. If \var{mode} is -not specified, \constant{'a'} is used. By default, the file grows +not specified, \constant{'a'} is used. If \var{encoding} is not \var{None}, +it is used to open the file with that encoding. By default, the file grows indefinitely. \end{classdesc} @@ -1004,6 +1005,41 @@ Closes the file. Outputs the record to the file. \end{methoddesc} +\subsubsection{WatchedFileHandler} + +\versionadded{2.6} +The \class{WatchedFileHandler} class, located in the \module{logging.handlers} +module, is a \class{FileHandler} which watches the file it is logging to. +If the file changes, it is closed and reopened using the file name. + +A file change can happen because of usage of programs such as \var{newsyslog} +and \var{logrotate} which perform log file rotation. This handler, intended +for use under Unix/Linux, watches the file to see if it has changed since the +last emit. (A file is deemed to have changed if its device or inode have +changed.) If the file has changed, the old file stream is closed, and the file +opened to get a new stream. + +This handler is not appropriate for use under Windows, because under Windows +open log files cannot be moved or renamed - logging opens the files with +exclusive locks - and so there is no need for such a handler. Furthermore, +\var{ST_INO} is not supported under Windows; \function{stat()} always returns +zero for this value. + +\begin{classdesc}{WatchedFileHandler}{filename\optional{,mode\optional{, + encoding}}} +Returns a new instance of the \class{WatchedFileHandler} class. The specified +file is opened and used as the stream for logging. If \var{mode} is +not specified, \constant{'a'} is used. If \var{encoding} is not \var{None}, +it is used to open the file with that encoding. By default, the file grows +indefinitely. +\end{classdesc} + +\begin{methoddesc}{emit}{record} +Outputs the record to the file, but first checks to see if the file has +changed. If it has, the existing stream is flushed and closed and the file +opened again, before outputting the record to the file. +\end{methoddesc} + \subsubsection{RotatingFileHandler} The \class{RotatingFileHandler} class, located in the \module{logging.handlers} diff --git a/Doc/lib/libsmtplib.tex b/Doc/lib/libsmtplib.tex index 962383f..a873a9d 100644 --- a/Doc/lib/libsmtplib.tex +++ b/Doc/lib/libsmtplib.tex @@ -185,7 +185,7 @@ or may raise the following exceptions: The server didn't reply properly to the \samp{HELO} greeting. \item[\exception{SMTPAuthenticationError}] The server didn't accept the username/password combination. - \item[\exception{SMTPError}] + \item[\exception{SMTPException}] No suitable authentication method was found. \end{description} \end{methoddesc} diff --git a/Doc/lib/libsocket.tex b/Doc/lib/libsocket.tex index 69877d3..1a231d3 100644 --- a/Doc/lib/libsocket.tex +++ b/Doc/lib/libsocket.tex @@ -331,25 +331,25 @@ Availability: \UNIX. \end{funcdesc} \begin{funcdesc}{ntohl}{x} -Convert 32-bit integers from network to host byte order. On machines +Convert 32-bit positive integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 4-byte swap operation. \end{funcdesc} \begin{funcdesc}{ntohs}{x} -Convert 16-bit integers from network to host byte order. On machines +Convert 16-bit positive integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation. \end{funcdesc} \begin{funcdesc}{htonl}{x} -Convert 32-bit integers from host to network byte order. On machines +Convert 32-bit positive integers from host to network byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 4-byte swap operation. \end{funcdesc} \begin{funcdesc}{htons}{x} -Convert 16-bit integers from host to network byte order. On machines +Convert 16-bit positive integers from host to network byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation. \end{funcdesc} diff --git a/Doc/lib/libtest.tex b/Doc/lib/libtest.tex index f89c707..f30b49b 100644 --- a/Doc/lib/libtest.tex +++ b/Doc/lib/libtest.tex @@ -281,6 +281,7 @@ Execute the \class{unittest.TestSuite} instance \var{suite}. The optional argument \var{testclass} accepts one of the test classes in the suite so as to print out more detailed information on where the testing suite originated from. +\end{funcdesc} The \module{test.test_support} module defines the following classes: @@ -299,4 +300,3 @@ Temporarily set the environment variable \code{envvar} to the value of Temporarily unset the environment variable \code{envvar}. \end{methoddesc} -\end{funcdesc} |