[ python-Bugs-959576 ] Can't build Python on POSIX w/o $HOME

SourceForge.net noreply at sourceforge.net
Thu Sep 29 22:04:25 CEST 2005


Bugs item #959576, was opened at 2004-05-24 19:16
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=959576&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
>Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Barry A. Warsaw (bwarsaw)
>Assigned to: Martin v. Löwis (loewis)
Summary: Can't build Python on POSIX w/o $HOME

Initial Comment:
If you're building Python on os.name == 'posix' but
when there is no $HOME defined in your environment, you
cannot build Python.  This is because in the bowels of
distutils, you end up in check_environ(), which has
these lines:

    if os.name == 'posix' and not
os.environ.has_key('HOME'):
        import pwd
        os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]

However, in a from-scratch build, the pwd module isn't
built by the time you get here.  I found this when
using SCons to build Python, since by default the
enclosing environment isn't passed to subprocesses.

I can work around this in my builds but Python's
setup.py should probably synthesize a $HOME if one
doesn't exist.  (Or maybe someone has a better idea for
a workaround).

----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-29 22:04

Message:
Logged In: YES 
user_id=1188172

Well, pwd will be built-in then, if that's a problem.

Assigning to loewis to look over it.

----------------------------------------------------------------------

Comment By: John Hein (jhein-sf)
Date: 2005-09-29 21:28

Message:
Logged In: YES 
user_id=59465

Let me revise that last comment.  There are some build
differences when this is done.

Uncommenting pwd in Setup.dist allows python to build, but
the 'pwd' extension (and pwd.so) does not get built.

And pwdmodule.o is ar'd into libpython2.4.a (& linked into
libpython2.4.so)


----------------------------------------------------------------------

Comment By: John Hein (jhein-sf)
Date: 2005-09-29 21:14

Message:
Logged In: YES 
user_id=59465

I had this problem, too.
The fix proposed by birkenfeld on 9/22 works for me.


----------------------------------------------------------------------

Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-22 09:19

Message:
Logged In: YES 
user_id=1188172

Seems that the pwdmodule entry in Modules/Setup.dist must be
uncommented.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=959576&group_id=5470


More information about the Python-bugs-list mailing list