-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Inconsistent behavior on Python 2.7 vs. Python 3.7 on Flask #360
Comments
Thanks for reporting @mostafa . That definitely seems suspicious. I don't have time to look into this right now, but if you do some digging and end up finding a fix, I'd gladly review and merge a PR. |
I'll try to look into it to see if I can fix it! As far as I can trace the issue, it is related to the |
Thanks for looking into it. |
As I investigated more, the issue rises due to some minor differences between Python 2.7 and Python 3.7 and those are:
This all mean that if one wants to parse JSON body from the request object and it is empty, it will return missing in case of Python 3.7, and raises an exception in Python 2.7. |
One possible (very quick) solution is to pass |
It seems that the issue that was fixed in 05d8e1f, has some relations to this bug. Because when I use the |
Ah, interesting. I see that your mostafa/grest#84 was merged, so it looks like 5.1.0 had the fix. Closing this for now. |
I merged it, but it didn't fix the issue. So I downgraded to 4.3.1 to be able to have a working version till the issue resolves. This BUG is playing a hide and seek game with me, hence why I named it inconsistent! |
It seems that the |
I monkey-patched the dumps and loads functions in flask with the ones from |
marshmallow-code/webargs#360 marshmallow-code/webargs#363 2. Add simplejson to requirements.txt 3. Remove quick-fix changes to tests 4. Bump webargs version to 5.1.0
marshmallow-code/webargs#360 marshmallow-code/webargs#363 2. Add simplejson to requirements.txt 3. Remove quick-fix changes to tests 4. Bump webargs version to 5.1.0
Hopefully the builds are passing now with the 5.1.0 version. |
Hey guys,
I am having an issue with webargs==5.x, in that, when I upgrade it from 4.x to 5.x, using Flask==1.0.2, it works and behaves normally on python 3.7, but it behaves differently on python 2.7 on the same code base. The issue is on this pull request mostafa/grest#84 and is evident on this build: https://travis-ci.org/mostafa/grest/builds/479199700. I've tried to trace my own code to see if there is a path I am not covering, but that seems not to be the case, because it passes all tests on python 3.x.
Thanks,
Mostafa.
The text was updated successfully, but these errors were encountered: