1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
From: Sophie Brun <sophie@offensive-security.com>
Date: Fri, 2 Jun 2023 14:54:23 +0200
Subject: Fix regular expression
==================================== ERRORS ====================================
_______________________ ERROR collecting test_Airmon.py ________________________
/usr/lib/python3/dist-packages/_pytest/python.py:618: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3/dist-packages/_pytest/pathlib.py:533: in import_path
importlib.import_module(module_name)
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1206: in _gcd_import
???
<frozen importlib._bootstrap>:1178: in _find_and_load
???
<frozen importlib._bootstrap>:1149: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:690: in _load_unlocked
???
/usr/lib/python3/dist-packages/_pytest/assertion/rewrite.py:168: in exec_module
exec(co, module.__dict__)
tests/test_Airmon.py:5: in <module>
from wifite.tools.airmon import Airmon
wifite/tools/airmon.py:12: in <module>
from ..config import Configuration
E File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.11/build/wifite/config.py", line 283
E chn_arg_re = re.compile("^\d+((,\d+)|(-\d+,\d+))*(-\d+)?$")
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E SyntaxError: invalid escape sequence '\d'
---
wifite/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/wifite/config.py
+++ b/wifite/config.py
@@ -291,7 +291,7 @@
Color.pl('{+} {C}option:{W} using {G}random mac address{W} when scanning & attacking')
if args.channel:
- chn_arg_re = re.compile(r"^\d+((,\d+)|(-\d+,\d+))*(-\d+)?$")
+ chn_arg_re = re.compile("^\\d+((,\\d+)|(-\\d+,\\d+))*(-\\d+)?$")
if not chn_arg_re.match(args.channel):
raise ValueError("Invalid channel! The format must be 1,3-6,9")
|