This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, schmir, terry.reedy
Date 2008-03-19.22:02:57
SpamBayes Score 0.056554303
Marked as misclassified No
Message-id <d38f5330803191502p120df2bcqecafe85f080c0ae2@mail.gmail.com>
In-reply-to <1205962117.15.0.169796240888.issue2413@psf.upfronthosting.co.za>
Content
And on some system "Unknown error: nnn" is returned with no error indication.

Your concern that the patch is invalid on some unidentified system.
This concern
can easily be addressed by checking for NULL return *in addition* to
the errno check.

The real question is whether it is desirable  to raise ValueError from
strerror() when
error code is out of bound.  I would say the existing code intends to
do exactly that,
but th error check is incorrect on at least one popular platform. I
believe it is better
to raise an error because as a user, seeing "unknown error has
occurred" message,
is one of the worst experiences.

On the other hand, if the consensus is that  strerror() should always
(short of out of
memory condition) return a string, then (assuming null return is a
possibility) the code
needs to be changed to return "Unknown error: nnn"  instead of raising an error.
History
Date User Action Args
2008-03-19 22:02:58belopolskysetspambayes_score: 0.0565543 -> 0.056554303
recipients: + belopolsky, terry.reedy, schmir
2008-03-19 22:02:57belopolskylinkissue2413 messages
2008-03-19 22:02:57belopolskycreate