Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return offset-aware modification time #818

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ def modified(self, path, version_id=None, refresh=False):
if "LastModified" not in info:
# This path is a bucket or folder, which do not currently have a modified date
raise IsADirectoryError
return info["LastModified"].replace(tzinfo=None)
return info["LastModified"]

def sign(self, path, expiration=100, **kwargs):
return self.url(path, expires=expiration, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions s3fs/tests/test_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,7 @@ def test_modified(s3):
s3.touch(file_path)
modified = s3.modified(path=file_path)
assert isinstance(modified, datetime.datetime)
assert modified.tzinfo is not None

# Test directory
with pytest.raises(IsADirectoryError):
Expand Down