Bugs item #1404213, was opened at 2006-01-12 20:59 Message generated for change (Comment added) made by wilson1442 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1404213&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Closed Resolution: Invalid Priority: 5 Submitted By: Jim Wilson (wilson1442) Assigned to: Nobody/Anonymous (nobody) Summary: os.getlogin() goes **poof** Initial Comment: "python -c "import os; getlogin()" rears its ugly head again. It complains it can't open "<string>" (Python 2.4.1, FC4). Strace confirms it: open("<string>", ...) = -1 ENOENT (No such file or ... open("<string>", ...) = -1 ENOENT ... open("/usr/lib/python24.zip/<string>", ...) = -1 ... open("/usr/lib/python2.4/<string>", ...) = -1 ... open("/usr/lib/python2.4/plat-linux2/<string>", ... open("/usr/lib/python2.4/lib-tk/<string>", ... open("/usr/lib/python2.4/lib-dynload/<string>", ... open("/usr/lib/python2.4/site-packages/<string>", ... [<two more long obscure directories>/<string> snipped.] I don't know what's in that "<string>" file, but it surely must be important. ---------------------------------------------------------------------- >Comment By: Jim Wilson (wilson1442) Date: 2006-01-12 21:58 Message: Logged In: YES user_id=1191155 Actually, my diagnosis was meant to be jocular. I don't have a clue what's happening. Someone else suggested using strace when this problem was reported earlier. Your explanation makes perfect sense. But ... that certainly narrows it down. If it ain't "os.getlogin()", that leaves only "import os;", right? ---------------------------------------------------------------------- Comment By: Georg Brandl (birkenfeld) Date: 2006-01-12 21:34 Message: Logged In: YES user_id=1188172 Your diagnosis is incorrect. The system's getlogin() sets errno 2, that is "No such file or directory". Thus os.getlogin() raises an OSError with this description. Python's "file name" for -c scripts is "<string>", and because Python wants to give you a traceback with lines and code context, it looks for the file "<string>". This has nothing to do with getlogin. ---------------------------------------------------------------------- Comment By: Jim Wilson (wilson1442) Date: 2006-01-12 21:17 Message: Logged In: YES user_id=1191155 Er... Of course, I intended: python -c "import os; os.getlogin()" diagnostic output was from: strace -e trace=open python -c "import os; os.getlogin()" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1404213&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com