Skip to content
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

[Bug]: replace os.getlogin() by getpass.getuser() #151

Open
fungiboletus opened this issue Mar 2, 2024 · 0 comments
Open

[Bug]: replace os.getlogin() by getpass.getuser() #151

fungiboletus opened this issue Mar 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fungiboletus
Copy link
Member

Looks like os.getlogin doesn't work well in Python. The documentation advises to use getpass.getuser instead.

$ python3
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getlogin()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 6] No such device or address
>>> import getpass
>>> getpass.getuser()
'fungiboletus'
@fungiboletus fungiboletus added the bug Something isn't working label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant