evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.96k stars 511 forks source link

incompatibility with python 3.12 #1132

Closed slynobody closed 5 months ago

slynobody commented 6 months ago

Describe the bug does not work anymore with python 3.12

Include the following information:

To Reproduce Describe in detail as much as you can what happened.

Steps to reproduce the behavior:

  1. work with os with python 3.11, everything works
  2. install python3.12
  3. opensnitch-ui throws errors
  4. See error

Post error logs: File "/usr/bin/opensnitch-ui", line 41, in from opensnitch.service import UIService File "/usr/lib/python3/dist-packages/opensnitch/service.py", line 18, in from opensnitch.dialogs.prompt import PromptDialog File "/usr/lib/python3/dist-packages/opensnitch/dialogs/prompt.py", line 17, in from opensnitch.desktop_parser import LinuxDesktopParser File "/usr/lib/python3/dist-packages/opensnitch/desktop_parser.py", line 3, in import pyinotify File "/usr/lib/python3/dist-packages/pyinotify.py", line 71, in import asyncore ModuleNotFoundError: No module named 'asyncore'

gustavo-iniguez-goya commented 6 months ago

Hi @slynobody ,

It seems that Debian's python3-pyinotify is still using the deprecated module asyncore. It has been removed in PEP-594: https://peps.python.org/pep-0594/#networking-modules

Last version on Debian Sid is 0.9.6-2 (Sat, 11 Jun 2022 21:27:16). Maybe we need to file a bug report in order to let them know about this error?

On our side, I'll try to reproduce and fix it.

slynobody commented 5 months ago

is there a workaround? python3.12 is on sid now replacing 3.11?

gustavo-iniguez-goya commented 4 months ago

I've just released v1.6.6 with a temporal solution. It should not crash now.

gustavo-iniguez-goya commented 4 months ago

Fedora "fixed" this issue almost a year ago:

https://src.fedoraproject.org/rpms/python-inotify/c/68a5a14134b8cefe47f1789dd444056abd8a70b8?branch=rawhide

gustavo-iniguez-goya commented 4 months ago

And now a fix has entered in Debian Sid :tada:

  * Add pyasyncore to Depends for support in Python >= 3.12.
    (Closes: #1075811, #1040102, #1075939)