summaryrefslogtreecommitdiff
path: root/py/moduerrno.c
AgeCommit message (Collapse)Author
2019-02-21Add CIRCUITPY macro; rename u* only when CIRCUITPY=1Dan Halbert
2019-02-21rename ure, ujson, and uerrno to re, json, and errnoDan Halbert
2019-02-06Add human readable text for ENOSPC.Craig Forbes
2018-11-13Support OSError attributesNoralf Trønnes
This adds support for the OSError attributes : errno, strerror, filename and filename2. CPython only sets errno if 2 arguments has been passed in. This has not been implemented here. CPython OSError.args is capped at 2 items for backward compatibility reasons. This has not been implemented here. MICROPY_CPYTHON_COMPAT has to be enabled to get these attributes. mp_common_errno_to_str() has been extended to check mp_errno_to_str() as well. This is done to ease reuse for the strerror argument.
2018-08-16Compress all translated strings with Huffman coding.Scott Shawcroft
This saves code space in builds which use link-time optimization. The optimization drops the untranslated strings and replaces them with a compressed_string_t struct. It can then be decompressed to a c string. Builds without LTO work as well but include both untranslated strings and compressed strings. This work could be expanded to include QSTRs and loaded strings if a compress method is added to C. Its tracked in #531.
2018-08-09Two fixes and translate more strings.Scott Shawcroft
* Fix finding translations with escaped characters. * Add back \r to translations since its needed by screen.
2018-07-23WIP: complete manual inspection of all significant changesDan Halbert
2018-06-01Provide mp_errno_to_str even without uerrnoMatt Wozniski
We can provide a basic version of mp_errno_to_str even if the uerrno module won't be provided. Rather than looking errno names up in the uerrno module's globals dict, we'll just rely on a simple mapping in the function itself.
2018-05-14Display human readable strings for common OSErrorsMatt Wozniski
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
2017-02-22py/moduerrno: Make list of errno codes configurable.Damien George
It's configurable by defining MICROPY_PY_UERRNO_LIST. If this is not defined then a default is provided.
2017-02-22py/moduerrno: Make uerrno.errorcode dict configurable.Damien George
It's configured by MICROPY_PY_UERRNO_ERRORCODE and enabled by default (since that's the behaviour before this patch). Without this dict the lookup of errno codes to strings must use the uerrno module itself.
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-05-28py/moduerrno: Add ECONNREFUSED, one of frequent networking errors.Paul Sokolovsky
2016-05-25py/moduerrno: Add EEXIST, EISDIR.Paul Sokolovsky
Useful to check file/dir operations result, in particular used by upip.
2016-05-13py/moduerrno: Add EACCES, pretty common error on Unix.Paul Sokolovsky
2016-05-12py/objexcept: Don't convert errno to str in constructor, do it in print.Damien George
OSError's are now printed like: OSError: [Errno 1] EPERM but only if the string corresponding to the errno is found.
2016-05-12py: Add mp_errno_to_str() and use it to provide nicer OSError msgs.Damien George
If an OSError is raised with an integer argument, and that integer corresponds to an errno, then the string for the errno is used as the argument to the exception, instead of the integer. Only works if the uerrno module is enabled.
2016-05-12py/moduerrno: Add more constants to the errno module.Damien George
2016-05-10py: Add uerrno module, with errno constants and dict.Damien George