Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 20037 - Python os.getlogin() fails
Summary: Python os.getlogin() fails
Status: RESOLVED DUPLICATE of bug 4647
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alastair Tse (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-27 06:20 UTC by Philippe Lafoucrière
Modified: 2005-07-17 13:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Lafoucrière 2003-04-27 06:20:22 UTC
I've got a strange error. When I use the os.getlogin() function I've got :

<i>
>>> os.getlogin()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OSError: [Errno 2] No such file or directory
>>>
</i>

This works on another Pc with python 2.2.1 (redhat 8)
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2003-04-28 16:11:11 UTC
can you please paste "emerge info"? 

it works on my side. do you have the file /var/run/utmp or /var/log/utmp?
Comment 2 Philippe Lafoucrière 2003-04-28 18:10:10 UTC
Here's emerge info output :

=================================================================
System uname: 2.4.20-gentoo-r2 i686 AMD Athlon(tm) MP Processor 1800+
GENTOO_MIRRORS=" http://212.219.56.162/sites/www.ibiblio.org/gentoo/ http://212.219.56.152/sites/www.ibiblio.org/gentoo/ ftp://ftp.easynet.nl/mirror/gentoo//"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow crypt encode gif jpeg gnome libg++ mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gtkhtml alsa gdbm berkdb slang readline bonobo svga tcltk java guile ruby mysql X sdl gpm tcpd pam libwww ssl perl esd imlib oggvorbis gtk qt kde motif opengl mozilla cups usb pda acpi scanner apm arts avi python"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O3 -pipe"
CXXFLAGS="-march=athlon-mp -O3 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"









And yes, I have a /var/run/utmp, but not /var/run/utmp

(what's that ?)
Comment 3 Alastair Tse (RETIRED) gentoo-dev 2003-04-28 18:18:52 UTC
hmm .. athlon-mp .. 

can you try lowering your optimisation and recompiling glibc and python?

-O3 is pretty experimental for athlon-mp

/var/lib/utmp is where getlogin finds who is logged in, and that "No Such File or Directory" error could indicate that it isn't there.
Comment 4 Philippe Lafoucrière 2003-04-30 11:09:17 UTC
I think I found the problem : I didn't check "BSD Process Accounting" in my kernel config... I can't reboot for the moment, so I can't test that  :(

NTL, this is probably the origin of the error
Comment 5 Alastair Tse (RETIRED) gentoo-dev 2003-04-30 18:24:56 UTC
i'm not sure about that. i don't have BSD Process Accounting in my kernel and os.getlogin() works fine for me. it might be possible its a compiler problem, try recompiling with -march=athlon-xp .. 
Comment 6 Alastair Tse (RETIRED) gentoo-dev 2003-05-10 09:47:26 UTC
Philippe,

are you still having os.getlogin() problems?

Comment 7 Alastair Tse (RETIRED) gentoo-dev 2003-05-19 15:57:24 UTC
please reopen if you've got more information or still have the problem
Comment 8 Philippe Lafoucrière 2003-05-19 18:15:45 UTC
hum yes, I still have the problem :(




Python 2.2.2 (#1, Apr 29 2003, 09:54:09) 
[GCC 3.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Welcome to rlcompleter2 0.95
for nice experiences hit <tab> multiple times
>>> import os
>>> os.getlogin()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OSError: [Errno 2] No such file or directory
>>> 
Comment 9 Philippe Lafoucrière 2003-05-21 03:59:45 UTC

*** This bug has been marked as a duplicate of 4647 ***