CLN-2830: Fix cloud copy --schedule crash on missing dateutil#334
Open
jsbcannell wants to merge 1 commit intomasterfrom
Open
CLN-2830: Fix cloud copy --schedule crash on missing dateutil#334jsbcannell wants to merge 1 commit intomasterfrom
jsbcannell wants to merge 1 commit intomasterfrom
Conversation
Handle ImportError in convert_dates_to_timestamps with a clear message instead of crashing. Update python-dateutil pin from 2.6.1 (2017) to >=2.8.2 for modern Python compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
vastzuby
approved these changes
Feb 20, 2026
vastzuby
approved these changes
Feb 20, 2026
| from dateutil import parser | ||
| except ImportError: | ||
| print("Error: python-dateutil is required for date parsing. Install it with: pip install python-dateutil") | ||
| raise SystemExit(1) |
Contributor
There was a problem hiding this comment.
nitpick : use sys.exit(1) instead for consistency
Contributor
|
Also theres 1 merge conflict bc I merged in a PR which updated the dateutil version |
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
import dateutilinconvert_dates_to_timestamps()withtry/except ImportError— prints clear install instructions instead of crashingpython-dateutilpin from==2.6.1(2017) to>=2.8.2for modern Python compatibilityThe other two
import dateutilcall sites in vast.py already handleImportErrorgracefully; this was the only unguarded one.Test plan
vastai cloud copy --schedule ...withpython-dateutilinstalled — works as beforevastai cloud copy --schedule ...withoutpython-dateutil— prints clear error message instead of tracebackpip install vastai— python-dateutil installs successfully with new version pin🤖 Generated with Claude Code