Skip to content

Crashes on packages with non-URL project_urls #148

@craigds

Description

@craigds

Before You Begin

Before proceeding, please make sure to follow these steps:

  • I have checked for similar issues in the project's issue tracker.
  • I have searched closed issues to see if a similar problem was reported
    before.

Issue Details

Description

Running this tool with a requirements.txt containing jsonpath-rw==1.4.0 fails with a pydantic error:

cdestigter@overthere:~/x (main) $ cat ./requirements.txt
jsonpath-rw==1.4.0
cdestigter@overthere:~/x (main) $ uv tool run licensecheck -r ./requirements.txt
Traceback (most recent call last):
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/bin/licensecheck", line 12, in <module>
    sys.exit(cli())
             ~~~^^
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/io/cli.py", line 139, in cli
    ec = main(licensecheckConf)
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/io/cli.py", line 163, in main
    incompatible, depsWithLicenses = checker.check(
                                     ~~~~~~~~~~~~~^
    	requirements_paths=set(requirements_paths),
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    	skip_dependencies=licensecheckConf.skip_dependencies,
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/checker.py", line 52, in check
    packages = package_info_manager.getPackages()
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/packageinforesolver.py", line 72, in getPackages
    return set(executor.map(self._get_package_info, self.reqs))
  File "/Users/cdestigter/.local/share/uv/python/cpython-3.14.0+freethreaded-macos-aarch64-none/lib/python3.14t/concurrent/futures/_base.py", line 639, in result_iterator
    yield _result_or_cancel(fs.pop())
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/cdestigter/.local/share/uv/python/cpython-3.14.0+freethreaded-macos-aarch64-none/lib/python3.14t/concurrent/futures/_base.py", line 311, in _result_or_cancel
    return fut.result(timeout)
           ~~~~~~~~~~^^^^^^^^^
  File "/Users/cdestigter/.local/share/uv/python/cpython-3.14.0+freethreaded-macos-aarch64-none/lib/python3.14t/concurrent/futures/_base.py", line 443, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/Users/cdestigter/.local/share/uv/python/cpython-3.14.0+freethreaded-macos-aarch64-none/lib/python3.14t/concurrent/futures/_base.py", line 395, in __get_result
    raise self._exception
  File "/Users/cdestigter/.local/share/uv/python/cpython-3.14.0+freethreaded-macos-aarch64-none/lib/python3.14t/concurrent/futures/thread.py", line 86, in run
    result = ctx.run(self.task)
  File "/Users/cdestigter/.local/share/uv/python/cpython-3.14.0+freethreaded-macos-aarch64-none/lib/python3.14t/concurrent/futures/thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/packageinforesolver.py", line 99, in _get_package_info
    version=lpi.get_version() or rpi.get_version(),
                                 ~~~~~~~~~~~~~~~^^
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/packageinforesolver.py", line 211, in get_version
    self.lazy_fetch()
    ~~~~~~~~~~~~~~~^^
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/licensecheck/packageinforesolver.py", line 191, in lazy_fetch
    self.resp = ProjectResponse.model_validate(raw_resp)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/cdestigter/.cache/uv/archive-v0/gafQPpdd18I0m8-lTlfcU/lib/python3.14t/site-packages/pydantic/main.py", line 732, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        obj,
        ^^^^
    ...<5 lines>...
        by_name=by_name,
        ^^^^^^^^^^^^^^^^
    )
    ^
pydantic_core._pydantic_core.ValidationError: 1 validation error for ProjectResponse
info.project_urls.Download
  Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='UNKNOWN', input_type=str]
    For further information visit https://errors.pydantic.dev/2.13/v/url_parsing

Expected Behavior

It should fail gracefully, perhaps with a warning. Adding the offending package to ignore_packages in the config should fix it

Actual Behavior

Big traceback above. ignore_packages has no effect

System Information

This crash occurs with licensecheck 2026.0.4 and 2026.0.5
It doesn't happen with 2026.0.1. (I get a different unrelated error when trying 2026.0.2,2026.0.3, so can't say if this issue is present in those releases)

attempted on both MacOS 26 & Debian 13

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions