Message11653
Logged In: YES
user_id=31392
This is not a Python bug. Python is just calling the
platform getlogin(). On my Linux box, a C program that
calls getlogin() reports exactly the same error. It returns
NULL and sets errno to ENOENT, which strerror() converts to
"No such file or directory."
The man page for getlogin on Linux says:
For most purposes, it is more useful to use the
environ
ment variable LOGNAME to find out who the user is.
This
is more flexible precisely because the user can set
LOG
NAME arbitrarily.
The same man page describes cuserid() and says:
Nobody knows precisely what cuserid() does - avoid
it in
portable programs - avoid it altogether - use
getp
wuid(geteuid()) instead, if that is what you meant.
DO
NOT USE cuserid().
|
|
Date |
User |
Action |
Args |
2007-08-23 14:04:21 | admin | link | issue584566 messages |
2007-08-23 14:04:21 | admin | create | |
|