Skip to content

License MPL-2.0-no-copyleft-exception is incorrectly treated as an exception during validation #118

Description

@bhllamoreaux

Hello, wanted to report a bug I encountered.

When validating license expressions with MPL-2.0-no-copyleft-exception, the parser throws an error like below:

>>> licensing.parse("MPL-2.0-no-copyleft-exception AND GPL-3.0-only", validate=True, strict=True)
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 536, in parse
    tokens = list(
             ^^^^^
  File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 601, in tokenize
    for token in tokens:
  File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 1030, in replace_with_subexpression_by_license_symbol
    raise ParseError(
boolean.boolean.ParseError: A license exception symbol can only be used as an exception in a "WITH exception" statement. for token: "MPL-2.0-no-copyleft-exception"

Despite 'exception' in the license ID, this license is an official SPDX license, and not a license exception. See: https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions