diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-10-30 23:57:16 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-10-31 00:02:43 +0100 |
| commit | 14603c0fed58ebbd137b39b1be2d645d5152716b (patch) | |
| tree | ee3a8a9c7b0e37647425fdfe032361393afcb055 /examples | |
| parent | ac5ac5f8ada90e3b41b998bd715497be4109b3ab (diff) | |
Make errno/strerror/filename available on IOError
An error reporting flaw was that most raised IOErrors got their
errno/strerror/filename fields stripped, due to wanting to show a custom
messages. The problem was that adding back 'errno' and 'strerror' made
IOError.__str__() always return a fixed string
("[Errno <errno>] <strerror>"), ignoring any custom message.
This is friendly to users, but unfriendly to scripts (the menuconfig had
a workaround). Make things friendly to both by raising an internal
subclass of IOError instead, that preserves errno/strerror/filename but
prints a custom message. The exception can then still be caught as
IOError/OSError by scripts.
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions
