-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
DevProd Correctness
-
Fully Compatible
-
Correctness 2026-01-26
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Add venv detection for Python 3.13 in js tests
Problem
The getPython3Binary() function in jstests/libs/python.js hardcodes a check for Python 3.10 to detect virtual environments. After upgrading to Python 3.13 (v5 toolchain), this detection fails, causing tests that require Python dependencies to fail with ModuleNotFoundError.
Current Behavior
getPython3Binary() checks if python --version returns Python 3.10:
const usingPython310 = /Python 3\.10/.exec(pythonVersion); if (usingPython310) { jsTest.log.info("Found python 3.10 by default. Likely this is because we are using a virtual environment."); return "python"; }
If not 3.10, it assumes no venv exists and uses bare toolchain Python (/opt/mongodbtoolchain/v5/bin/python3.13) which has no packages installed.
Example Failure
[js_test:client_source_authentication_restriction_mode] sh420703| Traceback (most recent call last): [js_test:client_source_authentication_restriction_mode] sh420703| File "/data/mci/.../jstests/sharding/libs/proxy_protocol_server.py", line 18, in <module> [js_test:client_source_authentication_restriction_mode] sh420703| from proxyprotocol.server.main import main [js_test:client_source_authentication_restriction_mode] sh420703| ModuleNotFoundError: No module named 'proxyprotocol'
- blocks
-
SERVER-116221 Reference python 3.13 in mongodb toolchain
-
- Closed
-
-
SERVER-116365 Reference python 3.13 for windows
-
- Closed
-
-
SERVER-117445 Reference python 3.13 for macos
-
- Closed
-