public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-6-g8325fde
Date: Sat, 16 Jul 2022 20:08:33 +0000 (GMT)	[thread overview]
Message-ID: <20220716200833.8827D3858D39@sourceware.org> (raw)




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=8325fded1ccb121c57ad689470a76542a8609500

commit 8325fded1ccb121c57ad689470a76542a8609500
Author: Jon Turney <jon.turney@dronecode.org.uk>
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):



                 reply	other threads:[~2022-07-16 20:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220716200833.8827D3858D39@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).