Skip to content

Stop using deprecated datetime.utcnow()#43

Open
c-tonneslan wants to merge 1 commit into
openstates:mainfrom
c-tonneslan:chore/utcnow-deprecation
Open

Stop using deprecated datetime.utcnow()#43
c-tonneslan wants to merge 1 commit into
openstates:mainfrom
c-tonneslan:chore/utcnow-deprecation

Conversation

@c-tonneslan
Copy link
Copy Markdown

Python 3.12 deprecated datetime.utcnow(). Swap the rate-limiter and the fixture helpers for datetime.now(timezone.utc).replace(tzinfo=None) so the on-the-wire shape stays naive and compares cleanly against the existing DateTimeField values.

Swap rate_limiter and the fixtures helpers - datetime.utcnow() is
deprecated in Python 3.12. .replace(tzinfo=None) keeps the naive
shape so the timestamps still compare against existing DateTimeField
values without USE_TZ warnings.

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
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.

1 participant