Comment 11 for bug 2004650

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The function indeed does a pass if the conversion fails, but if getting a none or other incompatible value would break as it does here.

pairs.append(("Valid until", format_expires(status["expires"])))
Crashes in
def format_expires(expires: datetime) -> str:
    try:
        expires = expires.astimezone()
    except Exception:
        pass
    return expires.strftime("%c %Z")

I think we should harden this to return a fallback text instead of crashing.

But the underlying root cause is something different.
You might have a very special account you connected this to which delivers bad data.
It is attached, I can see that in the code path it takes (you are in the non-free account type path, that it can only be if there is any data).
But then status["expires"]) is None

I'm sure we want to analyze that and then make the code ready to at least tolerate it.
Also we might need to fix your account in the contract server backend :-)