Skip to content
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

[Test] Use ssl.SSLContext.wrap_socket, not ssl.wrap_socket #33492

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

musicinmybrain
Copy link
Contributor

In the HTTP(S) test server in the core tests, use ssl.SSLContext.wrap_socket, not ssl.wrap_socket. The latter emits a DeprecationWarning since Python 3.10 and is removed in Python 3.12.

This fixes the core tests (but not necessarily the grpcio tests) for Python 3.12.

This is relevant to #33063.

The latter emits a DeprecationWarning since Python 3.10 and is removed
in Python 3.12.
@musicinmybrain musicinmybrain changed the title Use ssl.SSLContext.wrap_socket, not ssl.wrap_socket [Test] Use ssl.SSLContext.wrap_socket, not ssl.wrap_socket Jun 20, 2023
@yashykt yashykt requested a review from gnossen June 20, 2023 19:47
@gnossen gnossen added kokoro:run release notes: no Indicates if PR should not be in release notes labels Jun 20, 2023
@gnossen gnossen merged commit 011e116 into grpc:master Jun 21, 2023
7 of 8 checks passed
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Jun 22, 2023
gnossen pushed a commit that referenced this pull request Sep 6, 2023
…33506)

This API was [removed in Python
3.12](python/cpython#98040).

Fixes Python 3.12 support in `grpcio` tests.

This is relevant to #33063.

See also #33492.

----

I have actually only tested this in a form backported to grpc 1.48.4,
and I am not able to test the change to `bazel/_gevent_test_main.py`
directly. However, the backported form allows me to build grpc 1.48.4
for Fedora Rawhide with Python 3.12, and I believe the version in this
PR to be correct—especially, if CI passes for Python 3.11, I believe
this part of the test code will continue to work in Python 3.12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bloat/none imported Specifies if the PR has been imported to the internal repository lang/core lang/Python per-call-memory/neutral per-channel-memory/neutral release notes: no Indicates if PR should not be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants