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 rlblyler
Recipients
Date 2002-07-21.17:29:08
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The os.getlogin() fails with a no-such file. I
originally reported this bug to the gentoo bug tracking
system

see: http://bugs.gentoo.org/show_bug.cgi?id=4647

The issue seems to be that some xterminals ( gterm in
this case ) do not register themselves with utmp, which
this function uses.  I have two workarounds, one of
reverting back to using:

os.getenv('USER') 

and another for:

print pwd.getpwuid(os.geteuid())[0]

This seems to violate the portability of os.getlogin()
though, and was wondering if  a different internal
implementation should be used. I would expect that at
any rate it shouldn't cause a program to crash.

The following is the original error:

Traceback (most recent call last):
  File "./trilliji.py", line 25, in ?
    main()
  File "./trilliji.py", line 16, in main
    Connections = TriCon()
  File "./clsTriCon.py", line 16, in __init__
    self.login_user=os.getlogin()
OSError: [Errno 2] No such file or directory



History
Date User Action Args
2007-08-23 14:04:21adminlinkissue584566 messages
2007-08-23 14:04:21admincreate