-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.getlogin does not work #1
Comments
sounds good to me, will do that when I have a chance |
Fixes error on my Ubuntu / WSL setup: ``` >>> os.getlogin() Traceback (most recent call last): File "<stdin>", line 1, in <module> FileNotFoundError: [Errno 2] No such file or directory >>> getpass.getuser() 'olehermanse' ``` See: parmentelat/apssh#1 Changelog: None Ticket: None Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
AttributeError: 'module' object has no attribute 'getlogin' |
Hi
I could find only one instance of a call to that method, and it's protected in a try/except so this case should be taken care of the only place where we need to call this is in order to get a decent default for the username to use when logging into a remote box os.getlogin() has its caveats - as pointed out by @Asher256 - and using anybody up for a PR ? |
apssh does not work because of an exception raised by os.getlogin():
According to http://stackoverflow.com/questions/4399617/python-os-getlogin-problem :
I suggest you to replace os.getlogin with:
I my case, it solved the issue.
The text was updated successfully, but these errors were encountered: