Skip to content
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

Cannot import name 'json' from 'itsdangerous' #543

Closed
psrok1 opened this issue Feb 18, 2022 · 3 comments · Fixed by #551
Closed

Cannot import name 'json' from 'itsdangerous' #543

psrok1 opened this issue Feb 18, 2022 · 3 comments · Fixed by #551
Labels
type:bug Something isn't working zone:backend MWDB backend core related tasks

Comments

@psrok1
Copy link
Member

psrok1 commented Feb 18, 2022

With flask==1.1.2 we get the following errors:

ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.8/site-packages/itsdangerous/__init__.py)

We don't pin itsdangerous and it looks to be not properly pinned in flask==1.1.2.

Originally posted by @a1ext in #532 (comment)

@psrok1 psrok1 added type:bug Something isn't working zone:backend MWDB backend core related tasks labels Feb 18, 2022
@a1ext
Copy link

a1ext commented Feb 18, 2022

The issue is solved via taking requirements.txt from #532 + added one more line pinning itsdangerous==2.0.1

I think it is not right way but it makes it work right now.. The better way is to fix api_key.py to not used flask's dependencies directly :3

@psrok1
Copy link
Member Author

psrok1 commented Feb 18, 2022

Yes, we should not rely on the itsdangerous version pinning from Flask (which pins only the minimum version)

It broke on today's itsdangerous==2.1.0 release so I think that pin to the previous version should work correctly.

https://itsdangerous.palletsprojects.com/en/2.1.x/changes/#version-2-1-0

In addition: JWT features in itsdangerous used directly in MWDB are deprecated so we plan to move to the other library that is made for that purpose e.g. PyJWT (#530). @KWMORALE is already working on that: #542 so we should get rid of direct usage.

Ok, so I'm going to pin these dependencies on master and release a backport to 2.6.1 that will fix the current version.

@psrok1
Copy link
Member Author

psrok1 commented Feb 18, 2022

Should be fixed in 2.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working zone:backend MWDB backend core related tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants