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.

classification
Title: test_posix fails: getlogin
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: mbrierst, nnorwitz
Priority: normal Keywords:

Created on 2003-03-04 22:02 by mbrierst, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
posix.diff nnorwitz, 2003-03-07 00:09
Messages (5)
msg14949 - (view) Author: Michael Stone (mbrierst) Date: 2003-03-04 22:02
I see bug #690081 made this run only in interactive
mode, but it still fails for me when I do a make test.
Apparently my utmp is in an unexpected place,
/var/run/, which I guess doesn't agree with my libc?

I don't know how common this bug will be for other
people, but if anyone else experiences it you should
probably just get rid of the getlogin test altogether,
or at least catch the OSError: (2, 'No such file or directory')
and don't have that mean test failure.
msg14950 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-03-06 06:26
Logged In: YES 
user_id=33168

I'll take a look at this soon.
msg14951 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-03-07 00:09
Logged In: YES 
user_id=33168

Michael, can you test the attached patch?  It should fix the
problem.
msg14952 - (view) Author: Michael Stone (mbrierst) Date: 2003-03-07 04:05
Logged In: YES 
user_id=670441

Yeah, this patched fixed it just fine.

As long as I've got you here, should
test_socket require the network resource
be enabled?  It only works for me when I'm
connected.

When not connected testHostnameRes fails because
getfqdn() returns my hostname, 'zazz', but
gethostbyaddr(ip) returns the hostname 'localhost'.
When I am connected getfqdn() also returns
'localhost' so there's no problem.  It could be
fixed for me by either requiring the network
resource or changing line 234 of test_socket from:
all_host_names = [hname] + aliases
to:
all_host_names = [hname, hostname] + aliases
Or maybe my machine's setup is just messed
up in which case I trust you won't worry about it.
msg14953 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-03-18 13:43
Logged In: YES 
user_id=33168

Rather than implement the attached patch, I have removed the
test for getlogin().  The test had minimal benefit (it only
tested that getlogin() took no arguments).  It failed
several times for several different reasons.  It could also
fail under screen.  See
http://mail.python.org/pipermail/python-dev/2003-March/034120.html

Checked in as Lib/test/test_posix.py 1.5
History
Date User Action Args
2022-04-10 16:07:19adminsetgithub: 38096
2003-03-04 22:02:49mbrierstcreate