fix(cosmosdb): replace distutils.strtobool removed in Python 3.12#1018
Open
FidelusAleksander wants to merge 2 commits into
Open
fix(cosmosdb): replace distutils.strtobool removed in Python 3.12#1018FidelusAleksander wants to merge 2 commits into
FidelusAleksander wants to merge 2 commits into
Conversation
distutils was deprecated in Python 3.10 (PEP 632) and removed in 3.12. The cosmosdb module imports distutils.util.strtobool, which causes an ImportError on Python 3.12+. Replace with inline env-var truthiness checks against a module-level constant — no helper function or external dependency needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
21d2c2f to
faaebc1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
=======================================
Coverage 83.06% 83.06%
=======================================
Files 16 16
Lines 1730 1730
Branches 190 190
=======================================
Hits 1437 1437
Misses 236 236
Partials 57 57 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
LGTM |
Tranquility2
approved these changes
May 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
cosmosdbmodule importsdistutils.util.strtoboolin_emulator.py. Thedistutilsmodule was deprecated in Python 3.10 (PEP 632) and removed in Python 3.12. This causes anImportErrorwhen using the CosmosDB module on Python 3.12+: