manage.py run: Fix Package URL (pkg:) handling and comma-splitting in input_location

Open
#2,336 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Rucha0901 is already working on this.

Since Nov 16, 2026.

  • #2337 by @Rucha0901 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
30/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Read scanpipe/management/commands/run.py, especially get_input_options() and its handling of input_location. Reproduce with the two pkg: examples in the issue. Done means Package URLs reach create-project as input URLs and commas inside qualifiers are preserved; a linked pull request is already open for this issue.

Written by the indexing model from the issue text.

Description

Describe the bug
In scanpipe/management/commands/run.py, get_input_options() inspects the input argument using location.startswith(tuple(SCHEME_TO_FETCHER_MAPPING.keys())).
Because SCHEME_TO_FETCHER_MAPPING only maps http, https, and docker, Package URLs (pkg:) are not recognized as URLs. They fall into the file handling block, where Path("pkg:...").exists() fails with CommandError: pkg:... not found.
In addition, splitting input_location indiscriminately using split(",") breaks Package URLs that contain commas in qualifiers (for example: pkg:deb/debian/[email protected]?arch=i386,distro=jessie).

System configuration

  • Which version of ScanCode.io are you running? main branch
  • Are you running the app using Docker? No
  • On which OS? macOS
  • What inputs are you using? Package URL (e.g. pkg:npm/[email protected] or pkg:deb/debian/[email protected]?arch=i386,distro=jessie)
  • Which pipeline are you running? Any pipeline run via manage.py run (e.g. scan_single_package)

To Reproduce
Steps to reproduce the behavior:

  1. Run: python manage.py run scan_single_package pkg:npm/[email protected]
  2. See error: CommandError: pkg:npm/[email protected] not found.
  3. Or run: python manage.py run scan_single_package "pkg:deb/debian/[email protected]?arch=i386,distro=jessie"
  4. See error: CommandError: distro=jessie not found.

Expected behavior
Package URLs starting with pkg: should be recognized as input URLs, qualifiers containing commas should not be split, and inputs should be passed to create-project in input_urls.

Dominant language
Python
Stars
226
Forks
222
Avg merge
1d 5h
Merged PRs (30d)
32

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/scancode.io

All issues in aboutcode-org/scancode.io

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.