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

Aperta
#2,336 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Rucha0901 ci sta già lavorando.

Dal 16/11/2026.

  • #2337 di @Rucha0901 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
226
Fork
222
Merge medio
1g 5h
PR unite (30g)
32

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aboutcode-org/scancode.io

Tutte le issue di aboutcode-org/scancode.io

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.