Hi Nico,

On Mon, 2011-05-23 at 17:33 +0000, Debian Bug Tracking System wrote:
> Processing commands for cont...@bugs.debian.org:
> 
> > reassign 626310 swig
> Bug #626310 [stfl] stfl: FTBFS when there is no passwd entry for the build 
> user
> Bug reassigned from package 'stfl' to 'swig'.

Interesting bug. But why was this reassigned to swig?

> cd python2.7 && python2.7 -c 'import stfl'
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site.py", line 562, in <module>
>     main()
>   File "/usr/lib/python2.7/site.py", line 544, in main
>     known_paths = addusersitepackages(known_paths)
>   File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
>     user_site = getusersitepackages()
>   File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
>     user_base = getuserbase() # this will also set USER_BASE
>   File "/usr/lib/python2.7/site.py", line 236, in getuserbase
>     USER_BASE = get_config_var('userbase')
>   File "/usr/lib/python2.7/sysconfig.py", line 558, in get_config_var
>     return get_config_vars().get(name)
>   File "/usr/lib/python2.7/sysconfig.py", line 462, in get_config_vars
>     _CONFIG_VARS['userbase'] = _getuserbase()
>   File "/usr/lib/python2.7/sysconfig.py", line 205, in _getuserbase
>     return env_base if env_base else joinuser("~", ".local")
>   File "/usr/lib/python2.7/sysconfig.py", line 192, in joinuser
>     return os.path.expanduser(os.path.join(*args))
>   File "/usr/lib/python2.7/posixpath.py", line 260, in expanduser
>     userhome = pwd.getpwuid(os.getuid()).pw_dir
> KeyError: 'getpwuid(): uid not found: 2952'

Nothing in that backtrace has any relation to SWIG. What's going on here
is that python 2.7 is trying to find any user-local package during
initialization of the interpreter. 

The same thing happens when I create a test user, login and remove the
user from passwd while he is still active:

test@pulsar:/home/test$ python2.7 -c 'import sys'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
...
  File "/usr/lib/python2.7/sysconfig.py", line 192, in joinuser
    return os.path.expanduser(os.path.join(*args))
  File "/usr/lib/python2.7/posixpath.py", line 260, in expanduser
    userhome = pwd.getpwuid(os.getuid()).pw_dir
KeyError: 'getpwuid(): uid not found: 1001'

The same applies to python 2.6:

test@pulsar:/home/test$ python2.6 -c 'import sys'
'import site' failed; use -v for traceback

I am not sure if this can be considered a bug in python. Nobody says
that python should work when the current user does not exist.

OTOH it makes sense for the build of stfl to check if the library can be
imported.

Greetings, Torsten





-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to