From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 8827D3858D39; Sat, 16 Jul 2022 20:08:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8827D3858D39 To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-6-g8325fde X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 81315aef01a137bce51f636d96c3066b5cb4bb0b X-Git-Newrev: 8325fded1ccb121c57ad689470a76542a8609500 Message-Id: <20220716200833.8827D3858D39@sourceware.org> Date: Sat, 16 Jul 2022 20:08:33 +0000 (GMT) From: Jon TURNEY X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2022 20:08:33 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=8325fded1ccb121c57ad689470a76542a8609500 commit 8325fded1ccb121c57ad689470a76542a8609500 Author: Jon Turney Date: Sat Jul 16 20:50:20 2022 +0100 Workaround unexpected exceptions from license_expression.validate() [...] File "/home/cygwin/.local/lib/python3.6/site-packages/license_expression/__init__.py", line 1214, in __init__ 'Invalid license key: the valid characters are: letters and ' license_expression.ExpressionError: Invalid license key: the valid characters are: letters and numbers, underscore, dot, colon or hyphen signs and spaces: 'LGPLv3+/GPLv2+/GPLv3+/GFDLv1.3+' During handling of the above exception, another exception occurred: [...] File "/home/cygwin/.local/lib/python3.6/site-packages/license_expression/__init__.py", line 780, in validate expression_info.invalid_symbols.append(e.token_string) AttributeError: 'ExpressionError' object has no attribute 'token_string' Diff: --- calm/hint.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calm/hint.py b/calm/hint.py index 1e9d717..363cfb4 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -301,8 +301,9 @@ def hint_file_parse(fn, kind, strict=False): le = licensing.validate(value, strict=True) except (license_expression.ExpressionParseError, license_expression.ExpressionError) as e: errors.append('value for key %s not a valid license expression: %s' % (key, e)) - if le.original_expression != le.normalized_expression: - errors.append("license expression: '%s' normalizes to '%s'" % (value, le.normalized_expression)) + else: + if le.original_expression != le.normalized_expression: + errors.append("license expression: '%s' normalizes to '%s'" % (value, le.normalized_expression)) # warn if value starts with a quote followed by whitespace if re.match(r'^"[ \t]+', value):