Skip to content

DeprecationWarning: datetime.datetime.utcfromtimestamp() #431

@aschmidt-amplify

Description

@aschmidt-amplify

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Warning message:

.../python3.13/site-packages/google_auth_oauthlib/helpers.py:150: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    credentials.expiry = datetime.datetime.utcfromtimestamp(session.token["expires_at"])

Environment details

  • OS type and version: MacOS 15.6.1
  • Python version:3.13.3
  • pip version:25.0.1
  • google-auth-oauthlib version: 1.2.3

Steps to reproduce

I only see these warnings when running pytest on functions that usegoogle_auth_oauthlib

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions