Skip to content

A couple issues with MetadataCredentials #32

@lopatin

Description

@lopatin

Hello, first of all thanks for the great library.

I ran into two issues with MetadataCredentials when running on AWS Glue 4.0 with Python 3.10:

  1. Incorrect pattern for strptime.
Failed to update credentials
Traceback (most recent call last):
  File "/home/spark/.local/lib/python3.10/site-packages/aiohttp_s3_client/credentials.py", line 261, in _refresher
    credentials, expires_at = await self._fetch_credentials()
  File "/home/spark/.local/lib/python3.10/site-packages/aiohttp_s3_client/credentials.py", line 309, in _fetch_credentials
    datetime.datetime.strptime(
  File "/usr/local/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.10/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2024-08-14T09:39:55.439Z' does not match format '%Y-%m-%dT%H:%M:%SZ'
  1. Infinitely waits when calling await credentials.stop(). It seems to wait on the _refresher task to finish, which is a while True loop with no breaks.

I monkey patched both issues on my end to get unblocked, but just wanted to point this out. I'm happy to contribute a fix to the project if the maintainers agree it's something in need.

Thanks,
Alex

Metadata

Metadata

Assignees

No one assigned

    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