-
-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
Labels
staleIssues without activity for more than 60 daysIssues without activity for more than 60 days
Description
The 2.0.0 release introduces a regression in PyPy 3 support.
Expected Result
Tests passing with pypy3.
Actual Result
==================================================================== FAILURES =====================================================================
________________________________________________________ TestJWS.test_options_must_be_dict ________________________________________________________
self = <tests.test_api_jws.TestJWS object at 0x00007f705bc57670>, jws = <jwt.api_jws.PyJWS object at 0x00007f705bc46020>
def test_options_must_be_dict(self, jws):
pytest.raises(TypeError, PyJWS, options=object())
> pytest.raises(TypeError, PyJWS, options=("something"))
tests/test_api_jws.py:86:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jwt.api_jws.PyJWS object at 0x00007f705b5a26e8>, algorithms = None, options = 'something'
def __init__(self, algorithms=None, options=None):
self._algorithms = get_default_algorithms()
self._valid_algs = (
set(algorithms) if algorithms is not None else set(self._algorithms)
)
# Remove algorithms that aren't on the whitelist
for key in list(self._algorithms.keys()):
if key not in self._valid_algs:
del self._algorithms[key]
if options is None:
options = {}
> self.options = {**self._get_default_options(), **options}
E ValueError: sequence of pairs expected
jwt/api_jws.py:37: ValueError
____________________________________________________ TestJWS.test_decode_options_must_be_dict _____________________________________________________
self = <tests.test_api_jws.TestJWS object at 0x00007f7059ca8bb8>, jws = <jwt.api_jws.PyJWS object at 0x00007f7059ca8758>, payload = b'hello world'
def test_decode_options_must_be_dict(self, jws, payload):
token = jws.encode(payload, "secret")
with pytest.raises(TypeError):
jws.decode(token, "secret", options=object())
with pytest.raises(TypeError):
> jws.decode(token, "secret", options="something")
tests/test_api_jws.py:582:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
jwt/api_jws.py:165: in decode
decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jwt.api_jws.PyJWS object at 0x00007f7059ca8758>
jwt = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.aGVsbG8gd29ybGQ.gEW0pdU4kxPthjtehYdhxB9mMOGajt1xCKlGGXDJ8PM', key = 'secret', algorithms = None
options = 'something', kwargs = {}
def decode_complete(
self,
jwt: str,
key: str = "",
algorithms: List[str] = None,
options: Dict = None,
**kwargs,
) -> Dict[str, Any]:
if options is None:
options = {}
> merged_options = {**self.options, **options}
E ValueError: sequence of pairs expected
jwt/api_jws.py:138: ValueErrorReproduction Steps
tox -e pypy3-cryptoSystem Information
$ pypy3 -m jwt.help
{
"cryptography": {
"version": "3.3.1"
},
"implementation": {
"name": "PyPy",
"version": "7.3.3beta"
},
"platform": {
"release": "5.10.1",
"system": "Linux"
},
"pyjwt": {
"version": "2.0.0"
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleIssues without activity for more than 60 daysIssues without activity for more than 60 days