Skip to content

fix: split pip show output on the exact package separator#218

Open
apoorva-01 wants to merge 1 commit into
sourcegraph:scipfrom
apoorva-01:fix/pip-show-block-separator
Open

fix: split pip show output on the exact package separator#218
apoorva-01 wants to merge 1 commit into
sourcegraph:scipfrom
apoorva-01:fix/pip-show-block-separator

Conversation

@apoorva-01

Copy link
Copy Markdown

scip-python index blows up with Unexpected. Thought I should be getting files now if any dependency's License has a dashed line in it. pytest-django from the issue is the repro.

The pip show fallback splits packages on \n---, but pip actually separates them with a line of just ---. So pytest-django's ----... license rules get read as separators, its block gets shredded, and the parser trips on the leftover. Switched to splitting on the real separator line (/\r?\n---\r?\n/); only the fallback path changed. The test uses the two-package output from the issue and fails if you put the old split back.

(A lone --- on its own line in a license would still trip it, but I haven't seen that happen. Can reset the parser on each Name: instead if you'd rather.)

Closes #173

`\n---` also matches dashed lines inside a package's License (pytest-django),
so the block got shredded and indexing died.
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.

Unable to parse package informations containing \n---

1 participant