Skip to content

Commit bc99204

Browse files
committed
Fix documentation for function *parsedate_to_datetime*; mention that it raises a TypeError on invalid input instead of it returning None
1 parent 5d5a175 commit bc99204

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/email.utils.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ of the new API.
125125

126126
The inverse of :func:`format_datetime`. Performs the same function as
127127
:func:`parsedate`, but on success returns a :mod:`~datetime.datetime`;
128-
otherwise ``None`` may be returned if parsing fails, or a ``ValueError``
129-
raised if *date* contains an invalid value such as an hour greater than
130-
23 or a timezone offset not between -24 and 24 hours. If
128+
otherwise ``TypeError`` is raised if parsing fails because of an invalid input,
129+
or a ``ValueError`` raised if *date* contains an invalid value such as an hour
130+
greater than 23 or a timezone offset not between -24 and 24 hours. If
131131
the input date has a timezone of ``-0000``, the ``datetime`` will be a naive
132132
``datetime``, and if the date is conforming to the RFCs it will represent a
133133
time in UTC but with no indication of the actual source timezone of the

0 commit comments

Comments
 (0)