Skip to content

CLN-2830: Fix cloud copy --schedule crash on missing dateutil#334

Open
jsbcannell wants to merge 1 commit intomasterfrom
CLN-2830-fix-dateutil-crash
Open

CLN-2830: Fix cloud copy --schedule crash on missing dateutil#334
jsbcannell wants to merge 1 commit intomasterfrom
CLN-2830-fix-dateutil-crash

Conversation

@jsbcannell
Copy link
Contributor

Summary

  • Wrap bare import dateutil in convert_dates_to_timestamps() with try/except ImportError — prints clear install instructions instead of crashing
  • Update python-dateutil pin from ==2.6.1 (2017) to >=2.8.2 for modern Python compatibility

The other two import dateutil call sites in vast.py already handle ImportError gracefully; this was the only unguarded one.

Test plan

  • vastai cloud copy --schedule ... with python-dateutil installed — works as before
  • vastai cloud copy --schedule ... without python-dateutil — prints clear error message instead of traceback
  • pip install vastai — python-dateutil installs successfully with new version pin

🤖 Generated with Claude Code

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>
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)
Copy link
Contributor

@vastzuby vastzuby Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick : use sys.exit(1) instead for consistency

@vastzuby
Copy link
Contributor

vastzuby commented Feb 25, 2026

Also theres 1 merge conflict bc I merged in a PR which updated the dateutil version

#303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants