[issue4261] The pwd module doesn't distinguish between errors and no user

STINNER Victor report at bugs.python.org
Sun Mar 23 10:56:57 CET 2014


STINNER Victor added the comment:

According to the manual page, there is no guarantee that missing user and error give a different result. Extracts of the manual page.

"""
Return Value

The getpwnam() and getpwuid() functions return a pointer to a passwd structure, or NULL if the matching entry is not found or an error occurs. If an error occurs, errno is set appropriately. If one wants to check errno after the call, it should be set to zero before the call.

(...)

Errors

0 or ENOENT or ESRCH or EBADF or EPERM or ...

    The given name or uid was not found. 
"""

errno=0 is not always the case for mising user.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4261>
_______________________________________


More information about the Python-bugs-list mailing list