summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-10-29 18:01:24 (GMT)
committerFred Drake <fdrake@acm.org>2001-10-29 18:01:24 (GMT)
commit589abb721214665144b9d06e4817c69042ef30bf (patch)
tree1490e020511d50b647d9fceb6e707edb15f56414 /Doc/lib
parent1b58bff8a03a70583d9e23e12d73e99864b02740 (diff)
downloadcpython-589abb721214665144b9d06e4817c69042ef30bf.zip
cpython-589abb721214665144b9d06e4817c69042ef30bf.tar.gz
cpython-589abb721214665144b9d06e4817c69042ef30bf.tar.bz2
Add additional information on exceptions from time.mktime() and related to
improper time tuples passed to various functions. Based on comments from Andreas Jung.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libtime.tex9
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/lib/libtime.tex b/Doc/lib/libtime.tex
index 81d1352..6a789dd 100644
--- a/Doc/lib/libtime.tex
+++ b/Doc/lib/libtime.tex
@@ -73,7 +73,6 @@ nonzero fraction (\UNIX{} \cfunction{select()} is used to implement
this, where available).
\item
-
The time tuple as returned by \function{gmtime()},
\function{localtime()}, and \function{strptime()}, and accepted by
\function{asctime()}, \function{mktime()} and \function{strftime()},
@@ -97,6 +96,10 @@ under ``Year 2000 (Y2K) issues'' above. A \code{-1} argument as
daylight savings flag, passed to \function{mktime()} will usually
result in the correct daylight savings state to be filled in.
+When a tuple with an incorrect length is passed to a function
+expecting a time tuple, or having elements of the wrong type, a
+\exception{TypeError} is raised.
+
\end{itemize}
The module defines the following functions and data items:
@@ -174,7 +177,9 @@ is the full 9-tuple (since the dst flag is needed; use \code{-1} as
the dst flag if it is unknown) which expresses the time in
\emph{local} time, not UTC. It returns a floating point number, for
compatibility with \function{time()}. If the input value cannot be
-represented as a valid time, \exception{OverflowError} is raised. The
+represented as a valid time, either \exception{OverflowError} or
+\exception{ValueError} will be raised (which depends on whether the
+invalid value is caught by Python or the underlying C libraries). The
earliest date for which it can generate a time is platform-dependent.
\end{funcdesc}