fix: add error handling for datetime parsing#3074
Closed
JiayangLai wants to merge 1 commit intovinta:masterfrom
Closed
fix: add error handling for datetime parsing#3074JiayangLai wants to merge 1 commit intovinta:masterfrom
JiayangLai wants to merge 1 commit intovinta:masterfrom
Conversation
Wrap datetime.fromisoformat() in try/except to handle corrupted or unexpectedly formatted cached data gracefully. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Yes
Yahoo Mail: Search, Organize, Conquer
On Sun, Apr 19, 2026 at 8:22, Lai Jia ***@***.***> wrote:
Summary
- Add try/except around datetime.fromisoformat() to handle corrupted or unexpectedly formatted cached data gracefully
- When cached data has invalid fetched_at format, the repo will be re-fetched instead of crashing
Changes
- website/fetch_github_stars.py: Wrap datetime.fromisoformat() in try/except
Test plan
- Python syntax verification passed
🤖 Generated with Claude Code
You can view, comment on, or merge this pull request online at:
#3074
Commit Summary
- 2579f35 fix: add error handling for datetime parsing in fetch_github_stars
File Changes
(1 file)
- M website/fetch_github_stars.py (5)
Patch Links:
- https://github.com/vinta/awesome-python/pull/3074.patch
- https://github.com/vinta/awesome-python/pull/3074.diff
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Owner
|
I think it should just throw an exception if the datetime parsing fails. Sorry bro, close. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
datetime.fromisoformat()to handle corrupted or unexpectedly formatted cached data gracefullyfetched_atformat, the repo will be re-fetched instead of crashingChanges
website/fetch_github_stars.py: Wrapdatetime.fromisoformat()in try/exceptTest plan
🤖 Generated with Claude Code