[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

Yannick Gingras report at bugs.python.org
Mon May 19 22:14:39 CEST 2008


New submission from Yannick Gingras <ygingras at ygingras.net>:

EnvironmentError and its subclass OSError add the value of errno in 
their error message.  This value is an integer but the specific value 
in an implementation detail and the C runtime recommends that 
programmers use the symbolic values instead.  Ex: one should use 
ENODATA instead of 61.  For the same reason, the Python interpreter 
should try to return the symbolic value or errno when possible.

The attached patch replaces errno in EnvironmentError.__str__() by its 
symbolic value when possible.

----------
components: Interpreter Core
files: python-26-sympolic-errno.diff
keywords: patch
messages: 67074
nosy: ygingras
severity: normal
status: open
title: Patch to print symbolic value or errno in EnvironmentError.__str__()
versions: Python 2.6
Added file: http://bugs.python.org/file10377/python-26-sympolic-errno.diff

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2920>
__________________________________


More information about the Python-bugs-list mailing list