-
-
Notifications
You must be signed in to change notification settings - Fork 727
Open
Description
PyJWKClient causes ResourceWarning on Python 3.14 when JWKS endpoint returns HTTP errors.
Expected Result
When PyJWKClient.fetch_data() encounters an HTTP error (e.g., 401 Unauthorized), the request should be cleanly handled without resource warnings.
Actual Result
On Python 3.14, a ResourceWarning is raised during garbage collection:
ResourceWarning: Implicitly cleaning up <HTTPError 401: 'Unauthorized'>
Reproduction Steps
import jwt
import warnings
warnings.filterwarnings('default')
client = jwt.PyJWKClient("https://dev-example.us.auth0.com/.well-known/jwks.json")
try:
client.get_signing_keys()
except jwt.PyJWKClientConnectionError:
pass
# output:
# python3.14/tempfile.py:484: ResourceWarning: Implicitly cleaning up <HTTPError 404: 'Not Found'>
# _warnings.warn(self.warn_message, ResourceWarning)System Information
$ python -m jwt.help
{
"cryptography": {
"version": "46.0.3"
},
"implementation": {
"name": "CPython",
"version": "3.14.2"
},
"platform": {
"release": "25.2.0",
"system": "Darwin"
},
"pyjwt": {
"version": "2.10.1"
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels