[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2019-09-11 Thread Zachary Ware
Zachary Ware added the comment: I agree with Steven in that I'm not quite sure this is a good change, but I also see that it would be useful in some cases. Perhaps either a `check_sudo_user=False` keyword-only parameter, or a `vars_to_check=()` parameter would be better? Adding Gregory P.

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-27 Thread Amos S
Amos S added the comment: The use of environment variables like USER and LOGNAME instead of getuid() etc is done in order to try to get "who really initiated this process?" rather than "who this process belongs to?". This is hidden today when SUDO_USER is ignored. This also fits my

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: Versions 3.7 and below are all in feature-freeze, so this change could only apply to 3.8 and above. I don't know if this feature is desirable or not. If it is (sometimes?) desirable, my guess is that it would be undesirable to use SUDO_USER *unless* the

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-22 Thread Amos S
Change by Amos S : -- keywords: +patch pull_requests: +8903 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-16 Thread Amos S
New submission from Amos S : When doing "sudo python-script.py", the output of "getpass.getuser()" is pretty much useless for what it's used (I assume mainly logging and tracking purposes, that's what we use it for ourselves). I worked around this limitation by using it in expression likes: