New submission from Manickaraja Kumarappan <manickara...@gmail.com>:
Hi, We are using below command to get the original login user. In some cases folks sudo as different user and run commands. In some cases folks use switch to different user (su - <>) and then run command. In all cases we would like to get original user who logged into the terminal to run the command. We are using below command to get the same. user=os.getlogin() We got three RHEL linux systems with Python 3 and strangely on two of them this command works fine. However only on third system it is failing with below error OSError: [Errno 6] No such device or address Not sure if it is some o/s env setup which is causing this command to fail. Any pointers to run this command will be of great help so that we can pin point the issue. Please note on faiing system if I do python and then run the command it works fine without any issue. However if it is triggered through our Scheduler (Control M) it is failing with above message. Give below is the command how Scheduler triggers the job. /bin/su - edwadm -c /bin/sh -x <> Thanks Manick. ---------- components: Extension Modules messages: 370336 nosy: Manickaraja Kumarappan priority: normal severity: normal status: open title: os.getlogin() not working type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40821> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com