Skip to content

Conversation

@guix77
Copy link

@guix77 guix77 commented Nov 11, 2025

…tributeError

  • Add type checking for datetime and timedelta objects
  • Handle timedelta gracefully with error logging and fallback
  • Prevent crash and memory leak when timedelta is passed instead of datetime/string
  • Fixes AttributeError: 'datetime.timedelta' object has no attribute 'tzinfo'

…tributeError

- Add type checking for datetime and timedelta objects
- Handle timedelta gracefully with error logging and fallback
- Prevent crash and memory leak when timedelta is passed instead of datetime/string
- Fixes AttributeError: 'datetime.timedelta' object has no attribute 'tzinfo'
"convertDateTimeToUTC() received timedelta object instead of datetime/string: %s. This is a bug. Fallback to datetime utcnow"
% str(toConvert)
)
return str(datetime.utcnow())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure I want this to not fail hard. This would cause watched timestamps and added at timestamps to be now instead of the correct date.

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