Skip to content

parsedate accepts None #4713

@serhiy-storchaka

Description

@serhiy-storchaka

Functions parsedate(), parsedate_tz() and parsedate_to_datetime() in email.utils accept not only strings but also None. https://github.com/python/cpython/blob/master/Lib/email/_parseaddr.py#L67-L68

Actually they accept arbitrary false value, but None is the most common, because they are used in code like

server_timetuple = parsedate(resp.headers.get("Date"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions