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 Longpoke
Recipients Longpoke
Date 2010-04-29.20:30:28
SpamBayes Score 0.01147115
Marked as misclassified No
Message-id <1272573029.96.0.566961009055.issue8573@psf.upfronthosting.co.za>
In-reply-to
Content
This function in asyncore is buggy:

def _strerror(err):
    res = os.strerror(err)
    if res == 'Unknown error':
        res = errorcode[err]
    return res

- os.strerror may throw ValueError depending on the os, or return a string saying something like: "Unknown error 1234".
- os.strerror never returns "Unknown error" for me, so "Unknown error <err>" is always returned for me (Linux 2.6.32)
- if os.strerrror failed, it's likely that it wont be in errno.errcode either

Maybe it should be written like this:
def _strerror(err):
    try:
        return strerror(err)
    except ValueError:
        return "Unknown error {0}".format(err)
History
Date User Action Args
2010-04-29 20:30:30Longpokesetrecipients: + Longpoke
2010-04-29 20:30:29Longpokesetmessageid: <1272573029.96.0.566961009055.issue8573@psf.upfronthosting.co.za>
2010-04-29 20:30:28Longpokelinkissue8573 messages
2010-04-29 20:30:28Longpokecreate