Skip to content

PyJWT Exceptions #4745

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

Closed
NovaNekmit opened this issue Nov 5, 2020 · 3 comments
Closed

PyJWT Exceptions #4745

NovaNekmit opened this issue Nov 5, 2020 · 3 comments
Labels
stubs: false positive Type checkers report false errors

Comments

@NovaNekmit
Copy link

NovaNekmit commented Nov 5, 2020

Problems:

The exceptions are stubbed in jwt (ie. jwt.MissingRequiredClaimError), but not the more explicit jwt.exceptions (ie jwt.exceptions.MissingRequiredClaimError).
Definitions are here: https://github.com/python/typeshed/blob/master/third_party/3/jwt/__init__.pyi#L25

PyJWK{,Set,Client}Error Exceptions are missing (see https://github.com/jpadilla/pyjwt/blob/master/jwt/exceptions.py#L57)

MissingRequiredClaimError is missing the claim attribute (see https://github.com/jpadilla/pyjwt/blob/master/jwt/exceptions.py#L51).
Definition is here: https://github.com/python/typeshed/blob/master/third_party/3/jwt/__init__.pyi#L35)

@srittau
Copy link
Collaborator

srittau commented Nov 6, 2020

In typeshed we usually try to follow the implementation in cases like this, so some reshuffling of the exceptions seem in order. (I didn't check.) PRs welcome for these (and any other) issues.

@srittau srittau added the stubs: false positive Type checkers report false errors label Nov 6, 2020
@jdufresne
Copy link
Contributor

jdufresne commented Dec 15, 2020

FWIW, the PyJWT project has started including its own type annotations. Perhaps efforts would be better spent updating them in the library rather than in typeshed.

@hauntsaninja
Copy link
Collaborator

Closing as per #4856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

No branches or pull requests

4 participants