Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Tenzer
Copy link
Contributor

@Tenzer Tenzer commented Jul 17, 2024

Rather than using the datetime.utcnow() and datetime.utcfromtimestamp() methods which produce timezone-naive datetime objects, we should instead use datetime.now() and datetime.fromtimestamp() with UTC provided as the timezone, in order to create timezone-aware datetime objects.

This removes the DeprecationWarning that otherwise is raised since Python 3.12 for these methods.

Types of changes

Please check the type of change your PR introduces:

  • Release (new release request)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (PEP8, lint, formatting, renaming, etc)
  • Refactoring (no functional changes, no api changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build related changes (build process, tests runner, etc)
  • Other (please describe):

Checklist

Rather than using the `datetime.utcnow()` and `datetime.utcfromtimestamp()`
methods which produce timezone-naive datetime objects, we should instead use
`datetime.now()` and `datetime.fromtimestamp()` with UTC provided as the
timezone, in order to create timezone-aware datetime objects.

This removes the DeprecationWarning that otherwise is raised since Python 3.12
for these methods.
@nijel nijel merged commit fd7dd90 into python-social-auth:master Jul 17, 2024
@nijel
Copy link
Member

nijel commented Jul 17, 2024

Merged, thanks for your contribution!

@nijel nijel self-assigned this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants