[Python-bugs-list] [ python-Bugs-697556 ] test_posix fails: getlogin

SourceForge.net noreply@sourceforge.net
Tue, 18 Mar 2003 05:43:33 -0800


Bugs item #697556, was opened at 2003-03-04 17:02
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=697556&group_id=5470

Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Michael Stone (mbrierst)
Assigned to: Neal Norwitz (nnorwitz)
Summary: test_posix fails: getlogin

Initial Comment:

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.

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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-18 08:43

Message:
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

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

Comment By: Michael Stone (mbrierst)
Date: 2003-03-06 23:05

Message:
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.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-06 19:09

Message:
Logged In: YES 
user_id=33168

Michael, can you test the attached patch?  It should fix the
problem.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-06 01:26

Message:
Logged In: YES 
user_id=33168

I'll take a look at this soon.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=697556&group_id=5470