Tests fail on Python 3.12: `ssl.wrap_socket` removed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 1.2k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 16
Description
Two tests fail on Python 3.12 because they patch ssl.wrap_socket, which was removed in Python 3.12:
- tests/core/lib/test_ssl.py::TestSslMethod::test_create_tcp_socket
- tests/core/lib/test_socket.py::TestSocketMethod::test_create_tcp_socket
Error message:
AttributeError: <module 'ssl' from '.../python3.12/ssl.py'> does not have the attribute 'wrap_socket'
I believe this is mainly because Python 3.12 removed the deprecated ssl.wrap_socket() API (deprecated since 3.7).
Environment:
Python 3.12.8
Project supports Python 3.10–3.12 per pyproject.toml (python = "^3.10, <3.13") and docs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/core/lib/test_ssl.py::TestSslMethod::test_create_tcp_socket and tests/core/lib/test_socket.py::TestSocketMethod::test_create_tcp_socket, then inspect how each test patches ssl.wrap_socket. Update the tests to use an API supported by Python 3.12 while preserving their existing assertions, and run both tests across the supported Python versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100