Skip to content

Commit

Permalink
replaced deprecated datetime.utcnow() with datetime.now(datetime.UTC)
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamgiri-dev authored Nov 3, 2024
1 parent 31fe604 commit 0f96c1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions botocore/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def signature(self, string_to_sign, request):
def add_auth(self, request):
if self.credentials is None:
raise NoCredentialsError()
datetime_now = datetime.datetime.utcnow()
datetime_now = datetime.datetime.now(datetime.UTC)
request.context['timestamp'] = datetime_now.strftime(SIGV4_TIMESTAMP)
# This could be a retry. Make sure the previous
# authorization header is removed first.
Expand Down Expand Up @@ -559,7 +559,7 @@ class S3ExpressPostAuth(S3ExpressAuth):
REQUIRES_IDENTITY_CACHE = True

def add_auth(self, request):
datetime_now = datetime.datetime.utcnow()
datetime_now = datetime.datetime.now(datetime.UTC)
request.context['timestamp'] = datetime_now.strftime(SIGV4_TIMESTAMP)

fields = {}
Expand Down Expand Up @@ -818,7 +818,7 @@ class S3SigV4PostAuth(SigV4Auth):
"""

def add_auth(self, request):
datetime_now = datetime.datetime.utcnow()
datetime_now = datetime.datetime.now(datetime.UTC)
request.context['timestamp'] = datetime_now.strftime(SIGV4_TIMESTAMP)

fields = {}
Expand Down

0 comments on commit 0f96c1d

Please sign in to comment.