In our tests, with Python3.9:
- _load_rules calls self._compile_rule('^[0-9'))
- in _compile_rule, re.compile('^[0-9') fails, which raises exception.InvalidPropertyProtectionConfiguration and allows the test to pass
With Python3.10, _compile_rule does not fail, allowing to move further in _load_rules and hit CONFIGK.get, which fails.
Thanks for your report. There are actually two issues here: one with Python3.9 and one with our tests.
$ cat cfg
[^[0-9]]
create = fake-role
rade = fake-role
update = fake-role
delete = fake-role
$ cat cfg.py ConfigParser( ) '/tmp/cfg' ) sections( )[0])
import configparser
CONF = configparser.
CONF.read(
print(CONF.
$ python3.9 cfg.py
^[0-9
$ python3.10 cfg.py
^[0-9]
There was a bug in 3.9 preventing the name of the section from being properly read, and it was fixed in 3.10 (https:/ /github. com/python/ cpython/ commit/ 1cc6769e4146951 d47528a97e56ba1 e8e9ee7fc1).
In our tests, with Python3.9: rule('^ [0-9')) InvalidProperty ProtectionConfi guration and allows the test to pass
- _load_rules calls self._compile_
- in _compile_rule, re.compile('^[0-9') fails, which raises exception.
With Python3.10, _compile_rule does not fail, allowing to move further in _load_rules and hit CONFIGK.get, which fails.