Skip to content

Commit 96b9a73

Browse files
committed
Fix api.listdir out of bounds date
1 parent 719d51a commit 96b9a73

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

source/be.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,16 +1128,21 @@ def listdir(path=".") -> list:
11281128
else:
11291129
typ = "?"
11301130
stati = stat(path + "/" + i)
1131+
lt = time.localtime(946688400)
1132+
try:
1133+
lt = time.localtime(
1134+
stati[9]
1135+
+ be.based.system_vars["TIMEZONE_OFFSET"] * 3600
1136+
)
1137+
except OverflowError:
1138+
pass
11311139
res.append(
11321140
[
11331141
i,
11341142
typ,
11351143
[7, 7, 7],
11361144
stati[6],
1137-
time.localtime(
1138-
stati[9]
1139-
+ be.based.system_vars["TIMEZONE_OFFSET"] * 3600
1140-
),
1145+
lt,
11411146
"root",
11421147
"root",
11431148
]

0 commit comments

Comments
 (0)