-
Notifications
You must be signed in to change notification settings - Fork 338
Remove deprecated werkzeug import #35
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
Conversation
Thanks for your contribution. Werkzeug dropped the support of python3.4 pallets/werkzeug#1478 that is the reason why your tests are failing. @SteadBytes, @j5awry I think we should drop support for python 3.4 as well, we'll then end up with a v0.2.0 I guess. |
+1 to dropping Python 3.4. It's over 6 years old at this point, and Python 3.9 is around the corner. |
+1 for killing 3.4, and accepting this PR as is. Opening a ticket for Werkzeug and Flask pinning / uprevving and removing python 3.4 from our allowables |
@@ -413,7 +413,7 @@ def test_handle_non_api_error(self, app, client): | |||
|
|||
response = client.get("/foo") | |||
assert response.status_code == 404 | |||
assert response.headers['Content-Type'] == 'text/html' | |||
assert response.headers['Content-Type'] == 'text/html; charset=utf-8' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the addition of charset here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced by werkzeug 1.0 as well.
Related to pallets/werkzeug#1526
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain this in the commit message @plowman 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, I disagree about how useful this information will be for future commit archaeologists but sure, commit message: updated.
@@ -413,7 +413,7 @@ def test_handle_non_api_error(self, app, client): | |||
|
|||
response = client.get("/foo") | |||
assert response.status_code == 404 | |||
assert response.headers['Content-Type'] == 'text/html' | |||
assert response.headers['Content-Type'] == 'text/html; charset=utf-8' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change breaks the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's more complicated than that.
Only one test remains broken: the one running python 3.4
At first, we may think this change breaks the test, but in fact, what is really broken is the fact that werkzeug 1.0 is NOT available for python 3.4 hence the tests are running with an old version of werkzeug which does not insert the charset in the Content-Type header.
The proper fix is to remove python 3.4 from the test suite and completely drop support for python 3.4 (which is EOL for almost a year).
Hey @ziirish thanks for taking a look! Let me know if there's anything else you'd like to see in this PR. Also, I rebased from master and the tests are now failing for different reasons:
So it seems like it's expecting |
This breaks with werkzeug 1.0. Werkzeug was previously generating this warning: DeprecationWarning: The import 'werkzeug.cached_property' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.utils import cached_property' instead.
This package also has a bug related to importing werkzeug 1.0 which they fixed in 0.15.1.
As of werkzeug 1.0 the content-type changed to include "charset=utf-8".
The tests right now are broken on earlier werkzeug versions. Allow the latest werkzeug version so the tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Still facing this issue, would love a version upgrade since the fix is in already. |
Fixes: #34
This import breaks with werkzeug 1.0.
Before 1.0, werkzeug was generating this warning: