Skip to content

Conversation

@joanise
Copy link

@joanise joanise commented Jan 26, 2026

Purpose of This Pull Request

Please check the relevant option by placing an "X" inside the brackets:

  • Documentation update
  • Bug fix
  • New feature
  • Other (please explain):

Overview of Changes

As described in #137, licensecheck currently hits an unhandled exception when faced with a license with exception, such as is found in llvmlite.

The underlying issue is that not all tokens handled on line 121 of packageinfo.py have a key attribute.

My solution is to guard against this problem with getattr(x, "key", str(x)) which fixes the problem.

Related Issue

If this pull request addresses a specific issue, please mention it using the
format "Fixes #IssueNumber"

Fixes #137

Reviewer Focus

It's a pretty simple patch, so nothing specific.

Additional Notes

I wanted to provide unit testing with my PR, but I did not manage to get the existing suite to run correctly on either my Windows or Linux machine. I've added a minimal data file for testing, however:

licensecheck -r tests/data/issue_137.txt

raises an exception on the current master branch but outputs llvmlite │ APACHE-2.0 WITH LLVM-EXCEPTION;; BSD-2-CLAUSE as expected with this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AttributeError: 'LicenseWithExceptionSymbol' object has no attribute 'key'

1 participant