fix(server): accept the routed path in the index view - #545
Open
Eljees wants to merge 1 commit into
Open
Conversation
Both catch-all routes pass 'text' and the 404 handler passes 'ex', so every request to '/' raised TypeError and returned HTTP 500. Restores the signature from PR infobyte#537. Signed-off-by: Eljees <3.14hell@gmail.com>
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.
Fixes #543
GET /returns HTTP 500 on a fresh install because the view function and its routes disagree:Both routes supply
text, and the error handler suppliesex, so Flask always callsindex()with a keyword the signature doesn't accept:This is the same one-line change that PR #537 made and that was lost when master was re-synced (see #543 for the archaeology; #541 was closed with a workaround that no longer helps, because master itself is broken).
Reproduced before and after
Minimal Flask app with exactly these decorators, python:3.12 / Flask 3:
ex=None, text=Nonekeeps every existing caller working: the 404 handler still passes the exception, both routes still pass the captured path, and the body of the function is unchanged.One note from the issue that is worth acting on separately: the fix needs to land on whichever internal branch master is synced from, otherwise it will be dropped again the next time.
AI-assisted (LLM used for drafting); the reproduction above was run and verified by me.