Environment: - FreeBSD 14.4-RELEASE amd64 - Python 3.12.13 - security/binwalk 2.3.3_1 Problem: Binwalk no longer starts under Python 3.12 because it still imports the deprecated 'imp' module, which was removed in Python 3.12. Running binwalk results in: ModuleNotFoundError: No module named 'imp' I prepared and tested a compatibility patch that replaces the deprecated imp implementation with a Python 3.12-compatible alternative. Validation performed: - Binwalk starts successfully - Firmware signature scanning - Firmware extraction - python3 -m compileall The patch and validation procedure are available here: https://github.com/Mil3tus/binwalk-python312-freebsd-patch If useful, I'd be happy to provide additional testing or information.
*** Bug 296882 has been marked as a duplicate of this bug. ***
Thanks, committed!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3a09d88ff55ffd98f1df4b3aa6ede2bf3cbc7cd9 commit 3a09d88ff55ffd98f1df4b3aa6ede2bf3cbc7cd9 Author: Tales Bragança <tales.braganca@icloud.com> AuthorDate: 2026-08-02 19:43:44 +0000 Commit: Kurt Jaeger <pi@FreeBSD.org> CommitDate: 2026-08-02 19:45:50 +0000 security/binwalk: fix binwalk for use with python3.12 - replaces the deprecated imp implementation with a Python 3.12-compatible alternative. PR: 297235 Source: https://github.com/Mil3tus/binwalk-python312-freebsd-patch https://github.com/rampageX/firmware-mod-kit/issues/191 Reported-by: rodrigo .../files/patch-src_binwalk_core_magic.py (new) | 11 +++ .../files/patch-src_binwalk_core_module.py (new) | 45 ++++++++++++ .../files/patch-src_binwalk_core_plugin.py (new) | 83 ++++++++++++++++++++++ 3 files changed, 139 insertions(+)