Repository navigation
Conversation
Both "In-Depth Example" snippets returned str from a WSGI app, which wsgiref rejects with "write() argument must be a bytes instance", so they answered 500 instead of the output shown on the page. Return bytes and start the final example with the "Hashes:" line that the sample output already shows. Signed-off-by: YoungjuKim <fjvbn2003@gmail.com>
Merging this PR will not alter performance
Comparing Footnotes
|
This branch has not been deployed
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.
The two "In-Depth Example" snippets on the docs index page (
docs/index.md) returnstrobjects from a WSGI app. On Python 3,wsgirefrejects them withAssertionError: write() argument must be a bytes instance, so both snippets answer500 Internal Server Errorinstead of the output shown on the page. The same problem was reported for the old docs site in #36.This makes the snippets return bytes and starts the final example with the
Hashes:line that the sample output already shows.I extracted the three Python blocks from
docs/index.md, ran each in a thread instead ofserve_forever(), and hit them with curl. I used python-multipart 0.0.31 and CPython 3.12.14.-F foo=bar)Parsed value parameter named: fooGET /)write() argument must be a bytes instance)Hashes:-F file=@test.txt)Hashes:/Part hash: 0b64696c…d931(matchesshasum -a 256in the docs)I used an AI assistant (Claude) to help find and draft this change. I reviewed and tested it myself.
🤖 Generated with Claude Code
🤖 Generated with Claude Code