-
Notifications
You must be signed in to change notification settings - Fork 1
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
Not working with python3.8 #1
Comments
Hi @villivateur, sorry for replying late. ufw_default_policy = int(self._run_cmd(['sysctl', 'net.ipv4.ip_forward']).replace(" ", "").removeprefix('net.ipv4.ip_forward=').strip())
if not ufw_default_policy: return 'disabled' with these: if search(r'= (\d+)', self._run_cmd(['sysctl', 'net.ipv4.ip_forward'])).group(1) == '0':
return 'disabled' Tell me if the problem is solved this way. |
It works, thank you. |
Fine, I'll push the changes in the next few days. |
@villivateur |
However, it seems that there are still some typing hints like In README, it says |
Thanks, testing with python 3.5.4 (the minimum python3 version conda could install) I discovered integrated annotations were incompatible (but |
I use Ubuntu20.04 and python3.8 is the default python interpreter.
However, tufw uses many features that only supported by python3.9 or higher. I tried to install python3.10 but the dependencies messed up. For example,
ModuleNotFoundError: No module named 'distutils.util'
.I tried to edit the source code to make it compatible with python3.8, and delete code like
-> tuple[str, str]
as much as I can, but end up withAttributeError: 'str' object has no attribute 'removeprefix'
in"/usr/local/lib/python3.8/dist-packages/tufw/firewall.py", line 60
.Do you have any idea that make it work in Ubuntu 20.04? Or at least, post the minimum python version in README.
Thank you.
The text was updated successfully, but these errors were encountered: