Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRL get_revoked emits inconsistent types (NoneType vs. Tuple) #903

Closed
thecubic opened this issue Mar 30, 2020 · 1 comment
Closed

CRL get_revoked emits inconsistent types (NoneType vs. Tuple) #903

thecubic opened this issue Mar 30, 2020 · 1 comment

Comments

@thecubic
Copy link

thecubic commented Mar 30, 2020

TL;DR: PR #859

CRL get_revoked emits either a None or a Tuple depending on whether there are revoked certificates. This makes for awkward syntax by the caller:

_revoked: Optional[Tuple[Any]] = crl.get_revoked()
if _revoked is not None:
  for cert in _revoked:
    process_revoked_cert(cert)

vs:

for cert in crl.get_revoked():
  process_revoked_cert(cert)

(ends in TypeError: 'NoneType' object is not iterable)

The perception of callers is that the latter is the supported way, so I'm encountering bugs because None is not guarded against. But None doesn't belong here, IMHO

@facutuesca
Copy link
Contributor

Since the CRL API has been deprecated (see here), I think this one can be closed.

cc @alex @mhils

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants