Skip to content

Conversation

Trickyni-V56
Copy link

Testing the changes

  • I tested the changes in this PR: NO

@abenson
Copy link
Contributor

abenson commented Dec 9, 2024

What's the reasoning?

@Trickyni-V56
Copy link
Author

Without python3-setuptools installed, I'm getting this error:

  File "/usr/bin/thefuck", line 9, in <module>
    from thefuck.entrypoints.main import main
  File "/usr/lib/python3.12/site-packages/thefuck/entrypoints/main.py", line 2, in <module>
    from ..system import init_output
  File "/usr/lib/python3.12/site-packages/thefuck/system/__init__.py", line 7, in <module>
    from .unix import *  # noqa: F401,F403
    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/thefuck/system/unix.py", line 6, in <module>
    from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils'

After reinstalling python3-setuptools thefuck works properly.

@tranzystorekk
Copy link
Contributor

tranzystorekk commented Dec 12, 2024

setuptools does bring back the distutils module, but as mentioned in nvbn/thefuck#1473, the correct fix is instead to replace distutils.spawn.find_executable with shutil.which

@tranzystorekk
Copy link
Contributor

As upstream has gone unmaintained, I'd be extremely wary of taking on the task of backporting fixes to the ever-growing list of issues. Maybe we should revisit the topic once there is an acknowledged maintained fork.

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.

3 participants