Skip to content

Comments

Replace deprecated distutils usage (removed in Python 3.12)#2550

Open
abhishek-8081 wants to merge 1 commit intocryptoadvance:masterfrom
abhishek-8081:fix/remove-deprecated-distutils
Open

Replace deprecated distutils usage (removed in Python 3.12)#2550
abhishek-8081 wants to merge 1 commit intocryptoadvance:masterfrom
abhishek-8081:fix/remove-deprecated-distutils

Conversation

@abhishek-8081
Copy link

Fixes #2549

distutils was deprecated in Python 3.10 and fully removed in Python 3.12. This PR removes both usages from the codebase:

Changes

  1. server.py: Removed from distutils.core import setup — this import was not used anywhere in the file.

  2. util/common.py: Replaced from distutils.util import strtobool with an inline implementation inside the existing str2bool() function. The behavior is exactly the same — it accepts the same true values (y, yes, t, true, on, 1) and false values (n, no, f, false, off, 0) and raises ValueError for anything else.

Without this fix, Specter will crash on startup with ModuleNotFoundError: No module named 'distutils' if run on Python 3.12+.

- server.py: removed unused 'from distutils.core import setup' import
- util/common.py: replaced distutils.util.strtobool with an inline
  implementation in str2bool() that has the same behavior

Fixes cryptoadvance#2549
@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for specter-desktop-docs canceled.

Name Link
🔨 Latest commit 85a5b2c
🔍 Latest deploy log https://app.netlify.com/projects/specter-desktop-docs/deploys/698f2d5c2b476000087ee0e7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code uses distutils which is removed in Python 3.12+

1 participant