Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-textfsm for openSUSE:Factory checked in at 2022-02-02 22:42:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-textfsm (Old) and /work/SRC/openSUSE:Factory/.python-textfsm.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-textfsm" Wed Feb 2 22:42:01 2022 rev:8 rq:950797 version:1.1.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-textfsm/python-textfsm.changes 2021-12-19 17:23:25.439784066 +0100 +++ /work/SRC/openSUSE:Factory/.python-textfsm.new.1898/python-textfsm.changes 2022-02-02 22:43:02.058872777 +0100 @@ -1,0 +2,6 @@ +Sat Jan 29 16:53:20 UTC 2022 - Martin Hauke <[email protected]> + +- Update to version 1.1.3: + * Fix to mismatched parenthesis. + +------------------------------------------------------------------- Old: ---- textfsm-1.1.2.tar.gz New: ---- textfsm-1.1.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-textfsm.spec ++++++ --- /var/tmp/diff_new_pack.aPy3de/_old 2022-02-02 22:43:02.558869388 +0100 +++ /var/tmp/diff_new_pack.aPy3de/_new 2022-02-02 22:43:02.562869361 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-textfsm # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define oldpython python %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-textfsm -Version: 1.1.2 +Version: 1.1.3 Release: 0 Summary: Python module for parsing semi-structured text into python tables License: Apache-2.0 ++++++ textfsm-1.1.2.tar.gz -> textfsm-1.1.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/textfsm-1.1.2/tests/textfsm_test.py new/textfsm-1.1.3/tests/textfsm_test.py --- old/textfsm-1.1.2/tests/textfsm_test.py 2021-06-28 08:43:30.000000000 +0200 +++ new/textfsm-1.1.3/tests/textfsm_test.py 2022-01-28 06:34:22.000000000 +0100 @@ -70,6 +70,18 @@ v.Parse, 'Value beer (boo)hoo)') + # Escaped parentheses don't count. + v = textfsm.TextFSMValue(options_class=textfsm.TextFSMOptions) + v.Parse(r'Value beer (boo\)hoo)') + self.assertEqual(v.name, 'beer') + self.assertEqual(v.regex, r'(boo\)hoo)') + self.assertRaises(textfsm.TextFSMTemplateError, + v.Parse, + r'Value beer (boohoo\)') + self.assertRaises(textfsm.TextFSMTemplateError, + v.Parse, + r'Value beer (boo)hoo\)') + # Unbalanced parenthesis can exist if within square "[]" braces. v = textfsm.TextFSMValue(options_class=textfsm.TextFSMOptions) v.Parse('Value beer (boo[(]hoo)') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/textfsm-1.1.2/textfsm/parser.py new/textfsm-1.1.3/textfsm/parser.py --- old/textfsm-1.1.2/textfsm/parser.py 2021-06-28 08:43:30.000000000 +0200 +++ new/textfsm-1.1.3/textfsm/parser.py 2022-01-28 06:34:22.000000000 +0100 @@ -313,22 +313,20 @@ raise TextFSMTemplateError( "Invalid Value name '%s' or name too long." % self.name) - square_brackets = r'[^\]?\[[^]]*\]' - regex_without_brackets = re.sub(square_brackets, '', self.regex) - if (not re.match(r'^\(.*\)$', self.regex) or - regex_without_brackets.count('(') != regex_without_brackets.count(')')): + if self.regex[0]!='(' or self.regex[-1]!=')' or self.regex[-2]=='\\': raise TextFSMTemplateError( "Value '%s' must be contained within a '()' pair." % self.regex) + try: + compiled_regex = re.compile(self.regex) + except re.error as e: + raise TextFSMTemplateError(str(e)) self.template = re.sub(r'^\(', '(?P<%s>' % self.name, self.regex) # Compile and store the regex object only on List-type values for use in # nested matching if any([isinstance(x, TextFSMOptions.List) for x in self.options]): - try: - self.compiled_regex = re.compile(self.regex) - except re.error as e: - raise TextFSMTemplateError(str(e)) + self.compiled_regex = compiled_regex def _AddOption(self, name): """Add an option to this Value.
