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
WebOb does not validate if environment variables are str
#247
Comments
Thank you :-). |
This issue is limited to Python 2.x only:
I've added a new test that is marked as xfail on Py 2.x. I am not sure what the best way forward is to fix this when something messes with the |
In this case a downstream application messes with the environ, thereby causing WebOb to emit a unicode Location header. Only affects Py2.
Honestly, I liked the idea that it should just raise exception explaining what went wrong. And the bug is in Django, no idea if someone fixed it as they did not merge my PR ( django/django#6472 ) because of lack of follow-up. I don't have time to work on it though... |
WebOb changes
Location
header to make it absolute.So
("Location", "/pay/select/")
becomes("Location", u"http://hern.as/pay/select/")
.Problem is that it combine strings using plus sign
+
.Problem lies for this specific case in
_request_uri
method that doeswhich from
str
makesunicode
.This leads to that kind of exception:
Originally reported at Pylons/waitress#125
Fix for Django (to not send unicode path info and script name): django/django#6472
The text was updated successfully, but these errors were encountered: