nvbn / thefuck

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

Fix the fuck for Python 3.12 #1415

Closed mbridon closed 2 months ago

mbridon commented 7 months ago

The imp module has been long deprecated and has been removed entirely in Python 3.12.

This solution is what was suggested in the release notes: https://docs.python.org/3.12/whatsnew/3.12.html#imp

radrow commented 7 months ago

finally someone gave a fuck

mbridon commented 7 months ago

finally someone gave a fuck

I'd say I even gave "the fuck" 🤪

arion52 commented 7 months ago

oh wow cool thanks was about to check it out but yeah u got the job done :+1:

Payne680 commented 7 months ago

Waiting for the pull request to be merged 😎

krossekrabbe commented 7 months ago

This ~bit~ fucked me after upgrading to Fedora 39.

Installing from fork worked for me

cd /tmp
git clone https://github.com/mbridon/thefuck.git
pip uninstall thefuck
pip install -e ./thefuck
arion52 commented 7 months ago

This ~bit~ fucked me after upgrading to Fedora 39.

lmao same still hasn't been merged :confused:

radrow commented 7 months ago

Just FYI due to this bug my terminal is fucked up since the upgrade:

image

No, I am not going to comment the fuck out of my zshrc.

LoZeno commented 6 months ago

Adding my +1 to get this merged soon!

mbridon commented 5 months ago

I don't have Python 2.7 any more, so I'll be happy if you can help fix this issue so the fix I provided works on both 2.7 and 3.12 :grin:

lucazenari commented 4 months ago

As a workaround, while we wait for this PR to be merged, if anyone wants to install this fork the quickest way is:

pip uninstall thefuck
pip install https://github.com/mbridon/thefuck/archive/main.zip
tanenbaum commented 4 months ago

I've just learned that there is an imp compatibility package called python3-zombie-imp on most distros (e.g. https://packages.fedoraproject.org/pkgs/python-zombie-imp/python3-zombie-imp/) that patches around this.

mbridon commented 4 months ago

I've just learned that there is an imp compatibility package called python3-zombie-imp on most distros (e.g. https://packages.fedoraproject.org/pkgs/python-zombie-imp/python3-zombie-imp/) that patches around this.

Sure, that's a potential crutch, but fixing the issue is better 😉

fbe555 commented 2 months ago

Bump. I also ran into this issue after updating to ubuntu 24.04 (and by extension to python 3.12.3), and fixed it by installing from the fork. Seems like this is super duper ready to merge :)

mbridon commented 2 months ago

Well, I guess the original author @nvbn seems to have disappeared, so all it would take is for someone to fork the repo and merge this PR and then assume maintenance of the project.

I won't do it for health reasons, so if someone who commented on this PR wants to have a go at it then go ahead. 🤷

And when @nvbn comes back eventually, assume joint maintenance all together.

Free Software sometimes loses maintainers and find new ones, that's how it sometimes evolves and continues.

nomike commented 2 months ago

I believe this pull request could be closed. A fix for this is already in the master branch.

mbridon commented 2 months ago

Ah great, so the maintainer fixed the issue but didn't merge the PR which could have given me the credit...

Well, all that matters is that it's fixed. :shrug: