Skip to content

An exception is raised for invalid license IDs instead of continuing to process #598

Closed

Description

@mykter

Hi, I was testing out the dev/v4.x.x branch to see if the new SPDX license ID feature worked for us.

When generating a bom with:

cyclonedx-py --environment --format json --schema-version 1.4 -o bom.json

I hit this error:

license_expression.ExpressionError: Invalid license key: the valid characters are: letters and numbers, underscore, dot, colon or hyphen signs and spaces: 'Apache License, Version 2.0'

via this call.

I'm not familiar with the spec, but assuming this is bad license data in the package (prometheus-async in this case), I think cyclonedx-python shouldn't immediately stop processing, and rather should skip the license for this component and continue.

It looks like we're already catching one error and carrying on at that point.

Activity

  1. jkowalleck commented on Oct 16, 2023

    @jkowalleck
    Member

    FYI: dev/v4.x.x is not nearly finished.

  2. added this to the 4.0.0 milestone on Oct 16, 2023
  3. added
    bug
    on Oct 16, 2023
  4. jkowalleck commented on Oct 16, 2023

    @jkowalleck
    Member
  5. linked a pull request that will close this issuechore(deps): bump cyclonedx-python-lib #599on Oct 16, 2023
  6. jkowalleck commented on Oct 16, 2023

    @jkowalleck
    Member

    should be fixed by #599

    @mykter could you pull and install the latest dev/v4.x.x version and test again?

  7. mykter commented on Oct 19, 2023

    @mykter
    Author

    That works, thanks for the exceptionally speedy fix!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions