summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-02-14 16:31:31 -0500
committerDan Halbert <halbert@halwitz.org>2020-02-14 18:33:37 -0500
commite0753c4ad2a20b2feede6fa8732fc60895cd6097 (patch)
tree6b558e4090de7134a9a88c57015051d0d90d5370 /shared-bindings
parentcabc30e9a50e0bf87ab2130b6691d234941865ff (diff)
avoid os.stat() int overflow on smallint-only builds
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/os/__init__.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c
index c2b63bbce..f3b745aef 100644
--- a/shared-bindings/os/__init__.c
+++ b/shared-bindings/os/__init__.c
@@ -143,6 +143,11 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir);
//|
//| Get the status of a file or directory.
//|
+//| .. note:: On builds without long integers, the number of seconds
+//| for contemporary dates will not fit in a small integer.
+//| So the time fields return 946684800,
+//| which is the number of seconds corresponding to 1999-12-31.
+//|
mp_obj_t os_stat(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
return common_hal_os_stat(path);