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

Not python3.12 compatible due to distutils deprecation. #102

Closed
jace0x21 opened this issue Apr 20, 2024 · 1 comment · Fixed by #103
Closed

Not python3.12 compatible due to distutils deprecation. #102

jace0x21 opened this issue Apr 20, 2024 · 1 comment · Fixed by #103
Labels
bug Something isn't working

Comments

@jace0x21
Copy link
Contributor

jace0x21 commented Apr 20, 2024

On python3.12, import fickling leads to ModuleNotFoundError: No module named 'distutils'

distutils has been deprecated in python3.12.

distutils.sysconfig.get_python_lib specifically is called as having no direct replacement and is used in fickle.py to determine if a module is in the standard library or not.

@woodruffw
Copy link
Member

Thanks for the report @jace0x21!

Looks like this is the primary offending section:

STD_LIB = sysconfig.get_python_lib(standard_lib=True)
def is_std_module(module_name: str) -> bool:
base_path = Path(STD_LIB).joinpath(*module_name.split("."))
return (
base_path.is_dir()
or base_path.with_suffix(".py").is_file()
or module_name in BUILTIN_MODULE_NAMES
)

I believe we can straightforwardly replace this with stdlib-list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants