Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-131178: Add tests for http.server command-line interface#132540
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
79 commits Select commitHold shift + click to select a range
79db2f2
Add tests for http.server command-line interface
ggqlqa5e5220
Merge branch 'python:main' into main
ggqlq2b589bf
add news
ggqlqe11f8fe
add news
ggqlq4e008fd
lint
ggqlqad76ab1
move a new class into test
ggqlq5e563d3
Update Lib/http/server.py
ggqlq86b856e
Update Lib/http/server.py
ggqlq4d5c2b5
Update Lib/http/server.py
ggqlq574d6be
Update Lib/http/server.py
ggqlqc1f3358
Update Lib/http/server.py
ggqlq01d5fb8
Update Lib/http/server.py
ggqlq540700f
Update Lib/http/server.py
ggqlq1bdb0ec
Update Lib/test/test_httpservers.py
ggqlq38aea9e
Update Lib/test/test_httpservers.py
ggqlq3277327
update
ggqlq771263d
Update Lib/http/server.py
ggqlq3679a76
remove news
ggqlq6c58710
Update Lib/test/test_httpservers.py
ggqlq3e4a6aa
Update Lib/test/test_httpservers.py
ggqlq8e93c5d
Update Lib/test/test_httpservers.py
ggqlq439c36d
add no argument test and redirect stderr
ggqlq7e8aedc
wrap some lines to fit into 79 characters
ggqlq8f3e7ad
wrap some lines to fit into 79 characters(2)
ggqlq85cb099
Update Lib/test/test_httpservers.py
ggqlq9417864
Update Lib/test/test_httpservers.py
ggqlqa5a7d8c
Update Lib/test/test_httpservers.py
ggqlqa35e0d6
Update Lib/test/test_httpservers.py
ggqlqe2266c0
Update Lib/test/test_httpservers.py
ggqlqb4f9e72
Update Lib/test/test_httpservers.py
ggqlqa61b5b1
Update Lib/test/test_httpservers.py
ggqlqfd70932
update
ggqlq348e256
update
ggqlq4c315b0
update(2)
ggqlqa57b959
add cli test
ggqlqb627e02
add cli test(1)
ggqlq41065c2
add cli test(2)
ggqlqe7b7dff
Merge branch 'main' into main
ggqlqcbda832
move runtime tests into a new class
ggqlq86847e8
update
ggqlq7eb1572
Merge branch 'main' into main
ggqlqd504760
update
ggqlq811d86d
remove test_cli_flag function
ggqlqe5df251
Update Lib/test/test_httpservers.py
ggqlq1843c80
Update Lib/test/test_httpservers.py
ggqlq8e8b755
Update Lib/test/test_httpservers.py
ggqlq2f742d9
Update Lib/test/test_httpservers.py
ggqlqb5c5ab0
Update Lib/test/test_httpservers.py
ggqlq05aea06
Update Lib/test/test_httpservers.py
ggqlq333a761
split stdout and stderr, remove output check after self.assertRaises(…
ggqlq4304354
split tls tests
ggqlq6c4c134
Update Lib/test/test_httpservers.py
ggqlq7b3bb1d
Update Lib/test/test_httpservers.py
ggqlqeed4228
Update Lib/test/test_httpservers.py
ggqlq7c1713e
Update Lib/test/test_httpservers.py
ggqlqa34fa51
Update Lib/test/test_httpservers.py
ggqlq8f73c22
make invoke_httpd function return a pair
ggqlq2daf3f8
rename vars in wait_for_server function
ggqlq1c67654
use call_args = self.args | dict(...)
ggqlq9639219
rename 'random.bin' as 'served_filename'
ggqlq4156e78
fix indentation in test_missing_tls_cert_flag
ggqlq0522a17
add docstring for wait_for_server
ggqlq2c9612b
Merge branch 'main' into main
ggqlq1b5b3f8
capture the output outside invoke_httpd
ggqlq5637928
update terminate processes in test_http_client and test_https_client
ggqlq4a6b779
Merge branch 'main' into main
ggqlq6beb7f1
Update Lib/test/test_httpservers.py
ggqlq4c25dcd
Update Lib/test/test_httpservers.py
ggqlqd67ee16
Update Lib/test/test_httpservers.py
ggqlqd5914dc
Update Lib/test/test_httpservers.py
ggqlq4d0154e
Update Lib/test/test_httpservers.py
ggqlq2ba7001
Update Lib/test/test_httpservers.py
ggqlq0c37216
Update Lib/test/test_httpservers.py
ggqlq6938dd9
Update Lib/test/test_httpservers.py
ggqlq59be989
Update Lib/test/test_httpservers.py
ggqlq7a8d6f1
rename random_... as served_... in the CommandLineRunTimeTestCase class
ggqlq921739c
Update Lib/test/test_httpservers.py
ggqlq6d9981f
Update Lib/test/test_httpservers.py
ggqlq1d42f2c
Update Lib/test/test_httpservers.py
picnixzFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Update Lib/http/server.py
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
14 changes: 14 additions & 0 deletionsLib/http/server.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1383,6 +1383,20 @@ def _main(args=None): | ||
else: | ||
handler_class = SimpleHTTPRequestHandler | ||
ggqlq marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
# ensure dual-stack is not disabled; ref #38907 | ||
class DualStackServer(ThreadingHTTPServer): | ||
def server_bind(self): | ||
# suppress exception when protocol is IPv4 | ||
with contextlib.suppress(Exception): | ||
self.socket.setsockopt( | ||
socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0) | ||
return super().server_bind() | ||
def finish_request(self, request, client_address): | ||
self.RequestHandlerClass(request, client_address, self, | ||
directory=args.directory) | ||
test( | ||
HandlerClass=handler_class, | ||
ServerClass=ThreadingHTTPServer, | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.