[issue14238] python shouldn't need username in passwd database

Arkadiusz Miskiewicz Arkadiusz Miskiewicz report at bugs.python.org
Mon Mar 12 23:04:57 CET 2012


Arkadiusz Miskiewicz				Arkadiusz Miskiewicz <arekm at maven.pl> added the comment:

$  LC_ALL=C sudo -u '#9999' -g '#9999' /bin/sh -c 'unset HOME ; python -c ""'
Traceback (most recent call last):
  File "/usr/share/python2.7/site.py", line 567, in <module>
    main()
  File "/usr/share/python2.7/site.py", line 549, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/share/python2.7/site.py", line 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/share/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/share/python2.7/site.py", line 243, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/share/python2.7/sysconfig.py", line 522, in get_config_var
    return get_config_vars().get(name)
  File "/usr/share/python2.7/sysconfig.py", line 426, in get_config_vars
    _CONFIG_VARS['userbase'] = _getuserbase()
  File "/usr/share/python2.7/sysconfig.py", line 184, in _getuserbase
    return env_base if env_base else joinuser("~", ".local")
  File "/usr/share/python2.7/sysconfig.py", line 171, in joinuser
    return os.path.expanduser(os.path.join(*args))
  File "/usr/share/python2.7/posixpath.py", line 260, in expanduser
    userhome = pwd.getpwuid(os.getuid()).pw_dir
KeyError: 'getpwuid(): uid not found: 9999'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14238>
_______________________________________


More information about the Python-bugs-list mailing list