python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

teams.py - OverflowError: date value out of range

Open guochen-code opened this issue 2 years ago • 2 comments

The code has been working fine for a while (as you can see, at the bottom of the image, the code was run successfully and got the correct output results from Teams before), but suddenly the error occurred. I don't think I have changed anything in the system configuration.

image

I tried to debug and add print the local time zone and creaetedDateTime before line 261: self.created_date = parse(created).astimezone(local_tz) if created else None

I got the following results: image

My questions are: (1) why it printed twice? (2) and why the last createdDateTime was: 0001-01-01T00:00:00Z? what is the root cause for this?

Appreciate any suggestions to fix this. Thank you!

guochen-code avatar Aug 18 '22 14:08 guochen-code

I may fix this issue by change the source code in teams.py. Have to change both for "created" and "last_update":

image

At least it is working fine now: image

But I still don't get the answers for my above questions. Could you share possible root causes for this error? why "createdDateTime" was 0001-01-01T00:00:00Z. Thank you!

guochen-code avatar Aug 18 '22 14:08 guochen-code

I didn't write the code for Teams and don't have time right now to check the errors. I'm sorry. If you want to modify the code and make a PR it will be very welcome

alejcas avatar Aug 26 '22 13:08 alejcas