-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make responding with binary data work under Py3. #122
Closed
Closed
Conversation
This file contains 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
edf2d29
to
2ede2ea
Compare
51ddb9f
to
ae69a06
Compare
2ede2ea
to
46b5099
Compare
c867116
to
e9444d4
Compare
e9444d4
to
3060801
Compare
A previous revision fixed an immediate problem with test path handling but knowingly left some things on the table - in particular a split between container based handling of Python 2 and the local execution of Python 3 (meaning a potentially inconsistent version relative to what the project considers officially supported). Address this entirely: rework the default behaviour of `make test` to container based execution and use a consistent baseline Python 3. In order to continue to support rapid local iteration, provide a separate `make unittest` target which will execute the test suite locally and is also used as a mechanism to run other supporting tools. The clean use of containers necessitated various changes that make path arguments within the testconfig non-overlapping and better isolated. Adjust all paths generated within the test suite to be always from the base root instead of relative the output directory. Opt to patch the makeconfig generator rather than fiddle with generateconfs again. While here also add support for an environment variable overried that allows execution of the test suite against arbitrary python 3 versions.
Import the experimental branch version of force_utf8 wholesale adding a -py(2|3) suffix and expose the correct implementation dependent on PY2. Include forcing InputException messages to a native string as is done in experimental (also taken directly from that branch) which ensures the exception message, which may be unicode, becomes a string everywhere.
3060801
to
5089682
Compare
This PR does the principle things required to allow exercising the central component responsible for glueing named MiG "functionality" files to WSGI and have the result execute to completion under Python 3. Included is a small tactical change to allow the structural force recursive functions to iterate tuples preserving their type such that subsequence output behaves correctly under Py3. ======= wip fixup fixup updare and relocate a comment start tightening up the code shift things around a little work to make it readable with a nod towards further tests assert the response status allow programming the response repair previous assert that a programmed title ends up in the page line naming up with other recent work in grid_openid fixup fixup fixup fixup split the testing infrastructure across multiple files collect common default kwargs use noop for set environ make the generic WSGI handling setup code more uniform bring over improvements to hmtlsupp from another branch simplify fixup
The code as previously written would unconditionally encode parts as though they contained text - this went unnoticed on PY2 because strings and bytes are one and the same thing but blew up on PY3 where a string is explicitly of type unicode while a binary file would be raw bytes. Explicitly check the output_format and if instructed to serve a file do so without touching the chunks of file content bytes being yielded.
5089682
to
0270f09
Compare
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 code as previously written would unconditionally encode parts as
though they contained text - this went unnoticed on PY2 because strings
and bytes are one and the same thing but blew up on PY3 where a string
is explicitly of type unicode while a binary file would be raw bytes.
Explicitly check the output_format and if instructed to serve a file do
so without touching the chunks of file content bytes being yielded.
Depends on: #140
Depends on: #175