wheelgap diff with a missing file prints FileNotFoundError: [Errno 2] and the absolute path
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in _main() in src/wheelgap/diff.py, at the except Exception as e: block that formats type(e).__name__; compare it with how src/wheelgap/cli.py handles SourceError, TargetError, DockerfileError and OSError. Add an existence check for plain paths before reading each side and raise SourceError(f"{label}: no such file") with the argument as typed, leaving REF:PATH and --deps handling alone. Then add the missing-OLD and missing-NEW cases to tests/test_diff.py (exit 2, stderr wording, --json keys) using fake_pypi, and run that test file to check they pass where they failed before.
Written by the indexing model from the issue text.
Description
wheelgap diff with an OLD or NEW file that doesn't exist prints Python's exception name and the absolute path, where the main command says nope.txt: no such file:
Reproduced with the released uvx wheelgap==0.14.0 (same code on main):
$ printf 'idna==3.10\n' > requirements.txt
$ uvx wheelgap==0.14.0 diff nope.txt requirements.txt -p 3.13 -t linux-x86_64
wheelgap: error: FileNotFoundError: [Errno 2] No such file or directory: '/home/me/project/nope.txt'
$ uvx wheelgap==0.14.0 nope.txt -p 3.13 -t linux-x86_64
wheelgap: error: nope.txt: no such file
A typo in the path is the most common way to hit this, and the absolute path makes it harder to see which argument was wrong.
Where
_main() in src/wheelgap/diff.py: the except Exception as e: at the end of the input-reading block prints f"{type(e).__name__}: {e}" for everything. The main command (src/wheelgap/cli.py) prints SourceError, TargetError, DockerfileError and OSError without the type name, and only adds it for unexpected errors.
What to do
- Before reading each side, if it's a plain path (not git's
REF:PATH, not a--depsspec) and doesn't exist, raiseSourceError(f"{label}: no such file")with the argument as typed. - Optional, in the same PR if it stays small: print
SourceErrorandTargetErrorwithout the type-name prefix, as the main command does. Say in the PR which messages change.
Done when
- Tests in
tests/test_diff.py: a missing OLD and a missing NEW each exit 2 withnope.txt: no such fileon stderr (the path as typed, noErrno). With--json, the error object has the same keys (message,type). They fail onmain. - A
REF:PATHthat git can't read still gives git's error, as now. - No network in the tests (
fake_pypi). - One
CHANGELOG.mdbullet under## Unreleased.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from patrickballard/wheelgap
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
patrickballard/wheelgap#727 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
patrickballard/wheelgap#726 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
patrickballard/wheelgap#725 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
patrickballard/wheelgap#724 ·
-
--glibc 2 and --musl 1 are read as 2.0 and 1.0, so every compiled Linux package shows as sourceOpenbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
patrickballard/wheelgap#723 ·
All issues in patrickballard/wheelgap
Similar issues
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
docling-project/docling-core#1067 ·
Maintainers usually reply within 3 days
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 85/100
acl-org/acl-anthology#11101 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG] crewai tool create/install/login exit 0 when they failPossibly taken @Kiko0301 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vllm-project/compressed-tensors#1033 ·
Maintainers usually reply within 3 days
-
chore kaizen ui-rewrite
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
IBM/mcp-context-forge#7681 ·
Maintainers usually reply within 2 days