PynamoDB: _fast_parse_utc_date_string fails on pre year 1000
Python datetime supports dates back to year 0, but _fast_parse_utc_date_string forces datetimes to have four digit years. This resulted in the following error:
ValueError: Datetime string ‘539-02-20T08:36:49.000000+0000’ does not match format ‘%Y-%m-%dT%H:%M:%S.%f%z’
_fast_parse_utc_date_string should fall back to a library call if it fails.
Edit:
My bad, looks like datetime.datetime.strptime('539-02-20T08:36:49.000000+0000', '%Y-%m-%dT%H:%M:%S.%f%z') also fails, meaning isoformat() doesn’t produce parseable datetimes. 😕
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (8 by maintainers)
Commits related to this issue
- chore: Update Python packages In preparation for installing more. Hold pynamodb back until <https://github.com/pynamodb/PynamoDB/issues/899> is resolved. — committed to linz/geostore by l0b0 3 years ago
- chore: Update pynamodb Use past datetimes back to just after year 1000 to work around <https://github.com/pynamodb/PynamoDB/issues/899>. — committed to linz/geostore by l0b0 3 years ago
- chore: Update pynamodb Use past datetimes back to just after year 1000 to work around <https://github.com/pynamodb/PynamoDB/issues/899>. — committed to linz/geostore by l0b0 3 years ago
- chore: Update pynamodb Use past datetimes back to just after year 1000 to work around <https://github.com/pynamodb/PynamoDB/issues/899>. — committed to linz/geostore by l0b0 3 years ago
- chore: Update pynamodb (#425) Use past datetimes back to just after year 1000 to work around <https://github.com/pynamodb/PynamoDB/issues/899>. Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@... — committed to linz/geostore by l0b0 3 years ago
Yikes, you’re right. This is apparently platform dependent too: https://bugs.python.org/issue13305