A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-May/079494.html below:

[Python-Dev] Symbolic errno values in error messages

[Python-Dev] Symbolic errno values in error messages [Python-Dev] Symbolic errno values in error messagesYannick Gingras ygingras at ygingras.net
Fri May 16 12:52:35 CEST 2008
Hi, 
  I spent some time googleing for "OSError 4" before it occurred to me
that "4" was actually an irrelevant implementation detail.  As soon as
I searched for "EINTR", I found exactly what I was looking for.  (not
really but this is another story)

I jumped to the conclusion that OSError.__str__() should return the
symbolic error number instead of the integer value.  I was about to
write a patch but I just noticed that OSError and friends are
implemented in C so I guess it will be a bit harder than expected.

The error message comes from EnvironmentError.__str__() which is
implemented by EnvironmentError_str() in Objects/exceptions.c.  A
Python implementation could have replaced self.errno in the format
string args by errno.errorcode[self.errno].  However, it's not clear
to me if there is such a mapping available in C.

Since my fix is not as trivial as I expected, I ask for advice
regarding the following questions:

1) Should OSError.__str__() print the symbolic name of errno?

2) Where can I find the symbolic name in C?

Best regards, 

-- 
Yannick Gingras
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4