Skip to content

Commit 94ef88e

Browse files
authored
return offset-aware modification time (#818)
1 parent b31985d commit 94ef88e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

s3fs/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ def modified(self, path, version_id=None, refresh=False):
19921992
if "LastModified" not in info:
19931993
# This path is a bucket or folder, which do not currently have a modified date
19941994
raise IsADirectoryError
1995-
return info["LastModified"].replace(tzinfo=None)
1995+
return info["LastModified"]
19961996

19971997
def sign(self, path, expiration=100, **kwargs):
19981998
return self.url(path, expires=expiration, **kwargs)

s3fs/tests/test_s3fs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,7 @@ def test_modified(s3):
20332033
s3.touch(file_path)
20342034
modified = s3.modified(path=file_path)
20352035
assert isinstance(modified, datetime.datetime)
2036+
assert modified.tzinfo is not None
20362037

20372038
# Test directory
20382039
with pytest.raises(IsADirectoryError):

0 commit comments

Comments
 (0)