Skip to content

[pyjks] BksKeyEntry.type2str() can return None - #16872

Open
ArnabDutta01 wants to merge 1 commit into
python:mainfrom
ArnabDutta01:fix/pyjks-type2str-none
Open

ArnabDutta01 wants to merge 1 commit into
python:mainfrom
ArnabDutta01:fix/pyjks-type2str-none

Conversation

@ArnabDutta01

Copy link
Copy Markdown
Contributor

BksKeyEntry.type2str() returns None for an unknown key type. The docstring says so ("Returns one of PRIVATE, PUBLIC or SECRET, or None if no such key type is known"), but the stub leaves None out.

>>> from jks.bks import BksKeyEntry
>>> print(BksKeyEntry.type2str(99))
None

@srittau

srittau commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

But argument t is constrained to values where it doesn't return None, so this can't happen when using a type checker.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants