nvbn / thefuck

Magnificent app which corrects your previous console command.
MIT License
84.92k stars 3.43k forks source link

Not fully compatible with python 3.12.0 yet. #1418

Open jdsjdk opened 10 months ago

jdsjdk commented 10 months ago

When I first try running thefuck - I noticed that a deprecated python module is being used: imp. I can see that it has been replaced by importlib in the latest version.

I can tell that no one has reported this issue as of yet. Python 3.12.0 was just recently released.

The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release):

I'll provide what I can. Since the latest version of thefuck is not working with 3.12, then I just get the same error:

Traceback (most recent call last):
  File "/home/usr/.pyenv/versions/3.12.0/bin/thefuck", line 5, in <module>
    from thefuck.entrypoints.main import main
  File "/home/usr/.pyenv/versions/3.12.0/lib/python3.12/site-packages/thefuck/entrypoints/main.py", line 8, in <module>
    from .. import logs  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^
  File "/home/usr/.pyenv/versions/3.12.0/lib/python3.12/site-packages/thefuck/logs.py", line 8, in <module>
    from .conf import settings
  File "/home/usr/.pyenv/versions/3.12.0/lib/python3.12/site-packages/thefuck/conf.py", line 1, in <module>
    from imp import load_source
ModuleNotFoundError: No module named 'imp'

but my shell version is the following: fish, version 3.6.1 Oh My Fish version 7

Your system (Debian 7, ArchLinux, Windows, etc.):

CentOS 9 Stream.

How to reproduce the bug:

just type in thefuck or fuck and you should get that error once you install setuptools to fix the previous bug.

The output of The Fuck with THEFUCK_DEBUG=true exported (typically execute export THEFUCK_DEBUG=true in your shell before The Fuck): that really didn't do anything or have any significant change.

If the bug only appears with a specific application, the output of that application and its version:

N/A

Anything else you think is relevant:

N/A

minhtrancccp commented 10 months ago

there's already a pr for this: #1415 as it seems to take a while before the pr is accepted, you can consider installing from there instead

jaharkema commented 4 months ago

There is indeed a PR (which is closed, because apparently a fix already exists in master), but since the latest release (3.32) of thefuck is of January 2022 (which indeed is over two years ago at the moment of writing), the fix has not been rolled out...

I guess the workaround is to install thefuck from source and update it manually every now and then?
Less then ideal imho.