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

Fix import json_available error #136

Merged
merged 4 commits into from Apr 13, 2020
Merged

Fix import json_available error #136

merged 4 commits into from Apr 13, 2020

Conversation

crazyguitar
Copy link
Contributor

Hi,

Flask 1.1.0 remove json_available for compatibility. Please refer to the Flask commit.

commit d362399e7ebfe167a27daef20e198ecabed1b49b
Author: Gabriel Saldanha <gabrielcrsaldanha@gmail.com>
Date:   Wed Jun 27 08:23:44 2018 -0300

    :fire: Remove code supposed to be removed at v1.0

diff --git a/flask/__init__.py b/flask/__init__.py
index 1ab13c36..2e5670f5 100644
--- a/flask/__init__.py
+++ b/flask/__init__.py
@@ -43,7 +43,3 @@ from . import json
 # This was the only thing that Flask used to export at one point and it had
 # a more generic name.
 jsonify = json.jsonify
-
-# backwards compat, goes away in 1.0
-from .sessions import SecureCookieSession as Session
-json_available = True

thanks,
chang-ning

* Flask 1.1.0 or above remove json_available. ref: d362399e

Signed-off-by: chang-ning <spiderpower02@gmail.com>
Signed-off-by: chang-ning <spiderpower02@gmail.com>
@crazyguitar
Copy link
Contributor Author

crazyguitar commented Jul 6, 2019

By the way, Is it necessary to support Python 3.3 and old version Flask? I found Flask's compatibility with Python 3.3 is bad.

Signed-off-by: chang-ning <spiderpower02@gmail.com>
@lubomir-brindza
Copy link

Flask 1.1.0 dropped support for Python 3.4, so I suppose supporting it in a Flask extension doesn't make much sense.

@davidism
Copy link

davidism commented Apr 4, 2020

This needs to be merged and released to support Flask 2.0.

@crazyguitar
Copy link
Contributor Author

crazyguitar commented Apr 5, 2020

Hi,

I solved all conflicts. thx

@jnozsc
Copy link
Contributor

jnozsc commented Apr 12, 2020

cc @jcomo @jarus

@@ -35,7 +35,7 @@
from werkzeug.utils import cached_property

# Use Flask's preferred JSON module so that our runtime behavior matches.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this comment down to line 51 (where the import happens)?

Copy link
Collaborator

@jcomo jcomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Sorry that I didn't get around to this until now. I am going to submit a patch / new version to drop support for Flask < 1.0 altogether since those versions are ~8 years old now

@Garrett-R
Copy link

@jcomo seems like the there hasn't been a new version since 0.8.0 in March? Would be great to have a new version that included this fix.

Great repo BTW, thanks!

@jcomo
Copy link
Collaborator

jcomo commented Dec 24, 2020

@Garrett-R thanks for the ping. I just uploaded 0.8.1 to pypi. Cheers!

@Garrett-R
Copy link

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants