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

Python 3.12 support: ModuleNotFoundError: No module named 'imp' #313

Closed
Moult opened this issue Jun 10, 2024 · 10 comments
Closed

Python 3.12 support: ModuleNotFoundError: No module named 'imp' #313

Moult opened this issue Jun 10, 2024 · 10 comments

Comments

@Moult
Copy link
Contributor

Moult commented Jun 10, 2024

I recently tried compiling with Python 3.12 and when I run elinks I get this error:

ELinks: [Python 3.12.3 error] ModuleNotFoundError: No module named 'imp'

I think imp is now deprecated in favour of importlib. I did grep -ir "import " ./ --include "*.py" but couldn't see where imp was imported. Maybe it is used in a submodule?

@rkd77
Copy link
Owner

rkd77 commented Jun 10, 2024

Check this ^ commit.

@Moult
Copy link
Contributor Author

Moult commented Jun 10, 2024

Thank you! It is fixed!

@Moult Moult closed this as completed Jun 10, 2024
@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Oct 2, 2024

This is not really fixed... find_spec will not throw an exception if the hooks.py module is not found. It returns None instead.

So, the result of 2577da8 is that hooks_module_exists() incorrectly reports that the module does exist and python_init() fails later when trying to load a non-existent module.

@dimitry-ishenko
Copy link
Contributor

The fix is rather simple:

-		found_hooks = 1;
+		found_hooks = (result != Py_None);

@rkd77
Copy link
Owner

rkd77 commented Oct 2, 2024

Even, if simple, prepare a pull request, please. Bureaucracy.

@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Oct 2, 2024

Even, if simple, prepare a pull request, please. Bureaucracy.

Only if you release 0.17.1 with it right away... 😅 Need it for my own package (switching away from w3m).

@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Oct 2, 2024

@rkd77 Please see #333. If you wouldn't mind applying it to the 0.17.x series, I will appreciate that a lot.

rkd77 added a commit that referenced this issue Oct 3, 2024
@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Oct 3, 2024

@rkd77 I see you've started elinks-0.17 branch. 🎉 🎉 Will that help if I submit a separate PR for that?

@rkd77
Copy link
Owner

rkd77 commented Oct 4, 2024

No need to separate pull requests. If there is no "issues", I'll release 0.17.1 tommorow. Thanks for patch.

@dimitry-ishenko
Copy link
Contributor

@rkd77 thanks again for releasing the fix. FWIW I've spun up elinks-0.17.1.1 .deb packages for Ubuntu 22.04 and 24.04 here:

https://launchpad.net/~ppa-verse/+archive/ubuntu/dev

And was able to release my own packages for devdocs with code highlighting support. Check it out:

https://github.com/dimitry-ishenko-cpp/devdocs

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

No branches or pull requests

3 participants