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.Response.from_file parsing failure #250
Comments
You're parsing responses and linked to |
I've fixe this issue in 17e170d and added a test in 9aae43c so this can't regress. Thanks for reporting. I'll back port this to 1.6 this weekend. |
Sorry about the mispasted code. webob.Request.from_file parsing correctly, yes. webob.Response.from_file fails. Thanks for the quick fix. |
This fixes #250 by not attempting to split the entire string. This is required for any status codes that are not just <number> <one word status text> Things like 404 Not Found or 402 Payment Required.
webob.Request's from_file method seems have to an incorrect call to str.split()
Relevant code is here. The existing code works just fine on a 200 response but not on the faux 404
(http_ver, status_num, status_text) = status.split()
I suspect that this is inadvertent and that the following was probably intended.
(http_ver, status_num, status_text) = status.split(None, 2)
I was a little surprised I ran into this until I realized that parsing HTTP responses is probably not a terribly common use case.
The text was updated successfully, but these errors were encountered: