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)
can you please paste "emerge info"? it works on my side. do you have the file /var/run/utmp or /var/log/utmp?
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 ?)
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.
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
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 ..
Philippe, are you still having os.getlogin() problems?
please reopen if you've got more information or still have the problem
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 >>>
*** This bug has been marked as a duplicate of 4647 ***