@ziggy, I got the same warnings for those tests, but fail2ban is
running. I don't think this is an Ubuntu issue specifically. When I
searched for those errors, I found for example
https://stackoverflow.com/questions/52335970/how-to-fix-syntaxwarning-
invalid-escape-sequence-in-python which suggests that the issue might be
Python not liking unrecognized backslash-escape sequences in strings.
The source code that generates the first warning includes a comment
suggesting that the author of the tests (Serg Brester) was aware of the
issue and need for raw strings, but python was somehow handling it
automatically. The copyright date of that file is 2015 suggesting that a
different version of Python was used, probably Python 3.3.6 which
presumably responded differently to Python 3.12.3 in Ubuntu 24.04.1 LTS.

        # usage of <F-ID>\S+</F-ID> causes raw handling automatically:
        self.pruneLog()
        self.assertTrue(_test_exec(
            "-d", "^Epoch",
            "1490349000 test failed.dns.ch", "^\s*test <F-ID>\S+</F-ID>"
        ))

I'm not sure whether the tests were run as expected, but I don't think
we need to worry. Actually, it looks like the fail2ban maintainers have
already tweaked this file to use raw strings in
https://github.com/fail2ban/fail2ban/blob/master/fail2ban/tests/fail2banregextestcase.py#L224

                # usage of <F-ID>\S+</F-ID> causes raw handling automatically:
                self.pruneLog()
                self.assertTrue(_test_exec(
                        "-d", "^Epoch",
                        "1490349000 test failed.dns.ch", r"^\s*test 
<F-ID>\S+</F-ID>"
                ))

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2055114

Title:
  fail2ban is broken in 24.04 Noble

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fail2ban/+bug/2055114/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to