pallets-eco / flask-jwt

JWT (JSON Web Tokens) for Flask applications
MIT License
564 stars 178 forks source link

Collection.Mapping deprecated for python +3.10 #144

Closed hyper750 closed 3 years ago

hyper750 commented 3 years ago

When trying to use flask-jwt with a python version +3.10 (just importing jwt) returns an error, when trying to import collection.Mapping. Is using it inside the following files:

For the version of python 3.9 only shows a warning when trying to import it:

from collections import Mapping

<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

For the version of python +3.10 the import should be change to the following

from collections.abc import Mapping
tirkarthi commented 3 years ago

This seems to have been fixed in pyjwt which probably needs an update : https://github.com/jpadilla/pyjwt/commit/30d4c5a7f91e2425211b51c479f2f1e7a37f98b9