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

Change method for getting default user name, some sudo versions unexcepted working with getpass #67

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AndrewBille
Copy link
Contributor

For example sudo version 1.8.25p1:
[root@centos-8 ~]# sudo -u test sh -c 'python3 -c "import getpass; print(getpass.getuser())"';
root
[root@centos-8 ~]# sudo -u test sh -c 'python3 -c "import os; print(os.getlogin())"';
test

@AndrewBille AndrewBille changed the title Change method for getting default user name, some sudo versions working with getpass Change method for getting default user name, some sudo versions unexcepted working with getpass Sep 12, 2022
@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #67 (468b877) into master (4024049) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #67   +/-   ##
=======================================
  Coverage   95.93%   95.93%           
=======================================
  Files          18       18           
  Lines        1674     1674           
=======================================
  Hits         1606     1606           
  Misses         68       68           
Impacted Files Coverage Δ
testgres/defaults.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -1,4 +1,4 @@
FROM postgres:${PG_VERSION}-alpine
FROM postgres:${PG_VERSION}-alpine3.14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем эта фиксация версии?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в новом alpine python 3.10 и
A) там нужен крупный рефакторинг чтобы прошел flake8
Б) make html не работает на 3.10 (sphinxcontrib-napoleon не импортируется, ибо не обновлялся уже 4 года)
т.е. правка только для того, чтобы прошел тревис
пункты A и Б предлагаю решать отдельным большим issue

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://pypi.org/project/sphinxcontrib-napoleon/
As of Sphinx 1.3, the napoleon extension will come packaged with Sphinx under sphinx.ext.napoleon. The sphinxcontrib.napoleon extension will continue to work with Sphinx <= 1.2.

@@ -18,7 +18,7 @@ def default_username():
Return default username (current user).
"""

return getpass.getuser()
return pwd.getpwuid(os.getuid())[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А под Windows как это работает?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"No module named 'pwd'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants