[Python-bugs-list] [Bug #124758] Bogus error message from os.getlogin()

noreply@sourceforge.net noreply@sourceforge.net
Wed, 6 Dec 2000 12:44:20 -0800


Bug #124758, was updated on 2000-Dec-06 12:39
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 3
Submitted by: Nobody
Assigned to : fdrake
Summary: Bogus error message from os.getlogin()

Details: This is happening under Mandrake 7.2, although judging from the Python source, it would happen under any flavor of Unix.

When the real getlogin() returns NULL, posix_error() is called with some old value in errno. This causes os.getlogin() to raise OSError with a 
bogus error message. A bit confusing  to see "OSError: [Errno 2] No such file or directory" when attempting os.getlogin()  :-)

Bob Alexander
bobalex@adc.rsv.ricoh.com

Follow-Ups:

Date: 2000-Dec-06 12:44
By: gvanrossum

Comment:
Fred, would you mind fixing this? It seems to be your code. I'd reset errno to zero before calling getlogin(). But maybe errno is never set by getlogin() and then it's bogus to call posix_error().

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=124758&group_id=5470