Skip to content

Conversation

@mr-raj12
Copy link

@mr-raj12 mr-raj12 commented Jan 2, 2026

Summary

  • Fix get_advisory_url() in utils.py to accept both Path objects and strings
  • Converts string inputs to Path objects before calling .relative_to()
  • Resolves the AttributeError: 'str' object has no attribute 'relative_to' error

Issue

Fixes #2016

Changes

  • Added from pathlib import Path import
  • Added type checking with isinstance() to convert strings to Path objects

Testing

  • All 96 v2 importer tests pass
  • All 7 utils tests pass
  • Manually tested with both Path and string inputs

Signed-off-by: Mrityunjay Raj mr.raj.earth@gmail.com

The function now accepts both Path objects and strings for
the `file` and `base_path` parameters, converting strings to
Path objects before calling relative_to().

This fixes the AttributeError that occurred when importers
passed string paths instead of Path objects.

Fixes: aboutcode-org#2016

Signed-off-by: Mrityunjay Raj <mr.raj.earth@gmail.com>
@mr-raj12 mr-raj12 force-pushed the fix-istio-importer-path branch from f68153c to 1608222 Compare January 2, 2026 16:53
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.

Istio importer fails

1 participant