Skip to content

Commit 6b78709

Browse files
committed
set created_time to None if not available
1 parent f040872 commit 6b78709

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

fs/osfs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ def _make_details_from_stat(cls, stat_result):
152152
'size': stat_result.st_size,
153153
'type': int(cls._get_type_from_stat(stat_result))
154154
}
155-
if hasattr(stat_result, 'st_birthtime'):
156-
details['created'] = stat_result.st_birthtime
155+
# On other Unix systems (such as FreeBSD), the following
156+
# attributes may be available (but may be only filled out if
157+
# root tries to use them):
158+
details['created'] = getattr(stat_result, 'st_birthtime', None)
157159
ctime_key = (
158160
'created'
159161
if _WINDOWS_PLATFORM

0 commit comments

Comments
 (0)