Repository navigation
Conversation
Py2 expects this to be encoded while py3 expects this to be a string. Signed-off-by: Gerald H Spencer <ger.spencer3@gmail.com>
Author
csmarchbanks
reviewed
Jul 6, 2021
csmarchbanks
left a comment
Member
There was a problem hiding this comment.
Thank you for the fix! One comment, I am wondering if headers should also be cast as str, which is not happening on 119.
Would you be willing to add a test for this?
| status, header, output = _bake_output(registry, accept_header, params) | ||
| # Return output | ||
| start_response(status, [header]) | ||
| start_response(str(status), [header]) |
Member
There was a problem hiding this comment.
I wonder if lines 118 and 119 should just be cast as str similar to what the end of _bake_output does? Do you only see this issue for requests going to /favicon.ico or other locations as well?
Member
|
I ended up fixing this in a slightly different spot with #715, as well as casting the headers as strings which were also causing an exception. Thank you very much for the reproduction and start of a fix though! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
As noted #662. When running in python2.7 when requesting an endpoint, wsgi returns:
This is reproduced here: https://github.com/Geethree/prometheus-py27-string-bug
I'm not really sure of: