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"},
]
Summary
PypiVersionAPI.get_latest_date()inpackagedb/package_managers.pycan fail when a PyPI release entry is missingupload_time_iso_8601.The current implementation only assigns
current_datewhen that field is present, but still usescurrent_datelater in the loop even when it was never set. That can raiseUnboundLocalErrorinstead of skipping the malformed entry.Current behavior
A case like this can fail: