bpo-31327: Update time documentation to reflect possible errors (GH-3… · python/cpython@c83fc9c (original) (raw)

Original file line number Diff line number Diff line change
@@ -257,6 +257,12 @@ Functions
257 257 :const:`None`, the current time as returned by :func:`.time` is used. The dst
258 258 flag is set to ``1`` when DST applies to the given time.
259 259
260 +:func:`localtime` may raise :exc:`OverflowError`, if the timestamp is
261 + outside the range of values supported by the platform C :c:func:`localtime`
262 + or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or
263 +:c:func:`gmtime` failure. It's common for this to be restricted to years
264 + between 1970 and 2038.
265 +
260 266
261 267 .. function:: mktime(t)
262 268