From 58646a936e06fecec9f21ba482621bcfaebd8766 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 May 2022 14:01:30 -0400 Subject: [PATCH] Correct errno messages --- locale/circuitpython.pot | 12 ++++++++---- py/moduerrno.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3f8322c8dd..cbaa54b90e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1749,6 +1749,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1860,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2529,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/py/moduerrno.c b/py/moduerrno.c index 56d903f115..743be0b85d 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -140,7 +140,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { const compressed_string_t *desc = NULL; switch (MP_OBJ_SMALL_INT_VALUE(errno_val)) { case EPERM: - desc = MP_ERROR_TEXT("Permission denied"); + desc = MP_ERROR_TEXT("Operation not permitted"); break; case ENOENT: desc = MP_ERROR_TEXT("No such file/directory"); @@ -155,7 +155,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { desc = MP_ERROR_TEXT("File exists"); break; case ENODEV: - desc = MP_ERROR_TEXT("Unsupported operation"); + desc = MP_ERROR_TEXT("No such device"); break; case EINVAL: desc = MP_ERROR_TEXT("Invalid argument");