diff options
| author | Dan Halbert <halbert@adafruit.com> | 2020-02-04 18:41:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-04 18:41:17 -0500 |
| commit | 433671f5eb1e4ac94615301c3b41c6a01935274a (patch) | |
| tree | d94265500bd28047df73346068a42787b9050292 /extmod | |
| parent | 65045eb3bc4c61a5e4c538cdbf93b97f832f251e (diff) | |
| parent | 280e20adbeba23711bef3786e1bb1c7bbc87c825 (diff) | |
Merge pull request #2584 from dhalbert/oserror-with-filename5.0.0-beta.5
Include filename for 'No such file/directory', etc.
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/vfs_fat_file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 3ea9cee52..422f057a8 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -28,6 +28,7 @@ #if MICROPY_VFS && MICROPY_VFS_FAT #include <stdio.h> +#include <string.h> #include "py/runtime.h" #include "py/stream.h" @@ -199,7 +200,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar FRESULT res = f_open(&vfs->fatfs, &o->fp, fname, mode); if (res != FR_OK) { m_del_obj(pyb_file_obj_t, o); - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_errno_str(fresult_to_errno_table[res], args[0].u_obj); } // If we're reading, turn on fast seek. if (mode == FA_READ) { |
