Conversation
trytls.bundles.https.http_server uses the multiprocessing module to run the HTTPS server in its own subprocess. On Unix systems the multiprocessing module creates subprocesses by forking. On Windows subprocesses get spawned, which requires the multiprocessing.Process target to be picklable. The multiprocessing.Process target serve() was previously defined inside http_server's scope, which made serve() unpicklable. This commit makes serve() picklable by moving it to the module top level and renames it to _serve() to signal that it's meant for internal use.
Contributor
Author
|
I managed to reproduce #196 by forcing the |
|
Seems to be working now: Thanks for the quick fix 👍 |
Member
|
looks good to me. |
Member
|
Tested on the Windows 10. The original issue #196 appears to be fixed. However there was something strange with the openssl install I had in the localhost tests. See the paste below. I will merge this since this fixes the original issue and ignore the openssl issue for now. |
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.
This pull request is a potential fix for #196.
trytls.bundles.https.http_serveruses themultiprocessingmodule to run the HTTPS server in its own subprocess. On Unix systems themultiprocessingmodule creates subprocesses by forking. On Windows subprocesses get spawned, which requires themultiprocessing.Processtarget to be picklable.The
multiprocessing.Processtargetservewas previously defined insidehttp_server's scope, which madeserveunpicklable. The changes in this pull request makeservepicklable by moving it to the module top level and renames it to_serveto signal that it's meant for internal use.