Skip to content

[3.12] gh-109096: Silence test_httpservers fork + threads DeprecationWarning on CGI support #109471

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

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import datetime
import threading
from unittest import mock
import warnings
from io import BytesIO, StringIO

import unittest
Expand Down Expand Up @@ -699,7 +700,11 @@ def test_html_escape_filename(self):
"This test can't be run reliably as root (issue #13308).")
class CGIHTTPServerTestCase(BaseTestCase):
class request_handler(NoLogRequestHandler, CGIHTTPRequestHandler):
pass
def run_cgi(self):
# Silence the threading + fork DeprecationWarning this causes.
# gh-109096: This is deprecated in 3.13 to go away in 3.15.
with warnings.catch_warnings(action='ignore', category=DeprecationWarning):
return super().run_cgi()

linesep = os.linesep.encode('ascii')

Expand Down