Skip to content

Expat reference reported as unknown license reference #4971

@stefan6419846

Description

@stefan6419846

Description

https://github.com/PyCQA/pep8-naming/blob/main/LICENSE is wrongly being detected as being MIT AND LicenseRef-scancode-unknown-license-reference, where the unknown reference does not make much sense

How To Reproduce

  • wget https://github.com/PyCQA/pep8-naming/raw/1587bfe4ca73800d64a067580a8f6eb1b8dad209/LICENSE
  • scancode -l --license-text --license-text-diagnostics --yaml error.yml LICENSE
  • cat error.yml

Result

headers:
    -   tool_name: scancode-toolkit
        tool_version: 32.5.0
        options:
            input:
                - LICENSE
            --license: yes
            --license-text: yes
            --license-text-diagnostics: yes
            --yaml: error.yml
        notice: |
            Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES
            OR CONDITIONS OF ANY KIND, either express or implied. No content created from
            ScanCode should be considered or used as legal advice. Consult an Attorney
            for any legal advice.
            ScanCode is a free software code scanning tool from nexB Inc. and others.
            Visit https://github.com/nexB/scancode-toolkit/ for support and download.
        start_timestamp: '2026-05-04T084522.006054'
        end_timestamp: '2026-05-04T084526.103203'
        output_format_version: 4.1.0
        duration: '4.097162485122681'
        message:
        errors: []
        warnings: []
        extra_data:
            system_environment:
                operating_system: linux
                cpu_architecture: 64
                platform: Linux-6.4.0-150600.23.92-default-x86_64-with-glibc2.38
                platform_version: '#1 SMP PREEMPT_DYNAMIC Tue Mar 17 00:08:12 UTC 2026 (e41f89b)'
                python_version: 3.11.15 (main, Apr 07 2026, 21:55:08) [GCC]
            spdx_license_list_version: '3.27'
            files_count: 1
license_detections:
    -   identifier: mit-62c4d6f8-491a-c969-d5ad-fc7aa082658e
        license_expression: mit
        license_expression_spdx: MIT
        detection_count: 1
        reference_matches:
            -   license_expression: unknown-license-reference
                license_expression_spdx: LicenseRef-scancode-unknown-license-reference
                from_file: LICENSE
                start_line: 3
                end_line: 3
                matcher: 2-aho
                score: '100.0'
                matched_length: 5
                match_coverage: '100.0'
                rule_relevance: 100
                rule_identifier: license-intro_20.RULE
                rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/license-intro_20.RULE
                matched_text: Licensed under the terms of the Expat License
                matched_text_diagnostics: Licensed under the terms of
            -   license_expression: mit
                license_expression_spdx: MIT
                from_file: LICENSE
                start_line: 5
                end_line: 23
                matcher: 2-aho
                score: '100.0'
                matched_length: 161
                match_coverage: '100.0'
                rule_relevance: 100
                rule_identifier: mit.LICENSE
                rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE
                matched_text: |
                    Permission is hereby granted, free of charge, to any person
                    obtaining a copy of this software and associated documentation files
                    (the "Software"), to deal in the Software without restriction,
                    including without limitation the rights to use, copy, modify, merge,
                    publish, distribute, sublicense, and/or sell copies of the Software,
                    and to permit persons to whom the Software is furnished to do so,
                    subject to the following conditions:

                    The above copyright notice and this permission notice shall be
                    included in all copies or substantial portions of the Software.

                    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
                    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
                    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
                    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
                    BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
                    ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
                    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
                    SOFTWARE.
                matched_text_diagnostics: |
                    Permission is hereby granted, free of charge, to any person
                    obtaining a copy of this software and associated documentation files
                    (the "Software"), to deal in the Software without restriction,
                    including without limitation the rights to use, copy, modify, merge,
                    publish, distribute, sublicense, and/or sell copies of the Software,
                    and to permit persons to whom the Software is furnished to do so,
                    subject to the following conditions:

                    The above copyright notice and this permission notice shall be
                    included in all copies or substantial portions of the Software.

                    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
                    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
                    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
                    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
                    BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
                    ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
                    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
                    SOFTWARE.
files:
    -   path: LICENSE
        type: file
        detected_license_expression: mit
        detected_license_expression_spdx: MIT
        license_detections:
            -   license_expression: mit
                license_expression_spdx: MIT
                matches:
                    -   license_expression: unknown-license-reference
                        license_expression_spdx: LicenseRef-scancode-unknown-license-reference
                        from_file: LICENSE
                        start_line: 3
                        end_line: 3
                        matcher: 2-aho
                        score: '100.0'
                        matched_length: 5
                        match_coverage: '100.0'
                        rule_relevance: 100
                        rule_identifier: license-intro_20.RULE
                        rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/license-intro_20.RULE
                        matched_text: Licensed under the terms of the Expat License
                        matched_text_diagnostics: Licensed under the terms of
                    -   license_expression: mit
                        license_expression_spdx: MIT
                        from_file: LICENSE
                        start_line: 5
                        end_line: 23
                        matcher: 2-aho
                        score: '100.0'
                        matched_length: 161
                        match_coverage: '100.0'
                        rule_relevance: 100
                        rule_identifier: mit.LICENSE
                        rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE
                        matched_text: |
                            Permission is hereby granted, free of charge, to any person
                            obtaining a copy of this software and associated documentation files
                            (the "Software"), to deal in the Software without restriction,
                            including without limitation the rights to use, copy, modify, merge,
                            publish, distribute, sublicense, and/or sell copies of the Software,
                            and to permit persons to whom the Software is furnished to do so,
                            subject to the following conditions:

                            The above copyright notice and this permission notice shall be
                            included in all copies or substantial portions of the Software.

                            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
                            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
                            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
                            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
                            BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
                            ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
                            CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
                            SOFTWARE.
                        matched_text_diagnostics: |
                            Permission is hereby granted, free of charge, to any person
                            obtaining a copy of this software and associated documentation files
                            (the "Software"), to deal in the Software without restriction,
                            including without limitation the rights to use, copy, modify, merge,
                            publish, distribute, sublicense, and/or sell copies of the Software,
                            and to permit persons to whom the Software is furnished to do so,
                            subject to the following conditions:

                            The above copyright notice and this permission notice shall be
                            included in all copies or substantial portions of the Software.

                            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
                            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
                            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
                            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
                            BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
                            ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
                            CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
                            SOFTWARE.
                identifier: mit-62c4d6f8-491a-c969-d5ad-fc7aa082658e
        license_clues: []
        percentage_of_license_text: '93.79'
        scan_errors: []

System configuration

  • What OS are you running on? Linux
  • What version of scancode-toolkit was used to generate the scan file? 32.5.0
  • What installation method was used to install/run scancode? pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions