PypiVersionAPI.get_latest_date() crashes when a release entry is missing upload_time_iso_8601
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Open packagedb/package_managers.py and locate PypiVersionAPI.get_latest_date(). Reproduce the failure with the downloads list shown in the issue, then verify that an entry without upload_time_iso_8601 is skipped and the valid release date is still handled without an UnboundLocalError.
Written by the indexing model from the issue text.
Description
Summary
PypiVersionAPI.get_latest_date() in packagedb/package_managers.py can fail when a PyPI release entry is missing upload_time_iso_8601.
The current implementation only assigns current_date when that field is present, but still uses current_date later in the loop even when it was never set. That can raise UnboundLocalError instead of skipping the malformed entry.
Current behavior
A case like this can fail:
downloads = [
{},
{"upload_time_iso_8601": "2010-12-23T05:14:23.509436Z"},
]
- Dominant language
- HTML
- Stars
- 70
- Forks
- 76
- Avg merge
- 23m
- Merged PRs (30d)
- 2
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No 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 aboutcode-org/purldb
-
purlcli failsMay be free again @Anurag-S1ngh claimed this 18 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aboutcode-org/purldb#891 · 2 comments ·
-
Incorrect set comparison between package names and PURLs in NPM sync logicPossibly taken @MuhammadBilal64 claimed this 45 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
aboutcode-org/purldb#890 · 1 comment ·
-
Add doctest and tests for clearcode coordinate helpersPossibly taken @drawliin claimed this 236 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aboutcode-org/purldb#861 ·
-
Preserve version ordering in packagedb VersionResponsePossibly taken @drawliin claimed this 237 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aboutcode-org/purldb#857 ·
-
NameError: 'e' referenced outside except block in visit_uri() when visit_error is setPossibly taken @mohityadav8 claimed this 243 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aboutcode-org/purldb#851 ·
All issues in aboutcode-org/purldb
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
hurttlocker/o8#6535 ·
-
area: backend bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
snapotter-hq/SnapOtter#4856 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
vLLM metrics adapter tests start the adapter twice and race on its request countersPossibly taken @bhargavchintam claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
llm-d/llm-d-inference-sim#933 ·
Maintainers usually reply within 2 days