Mailing List Archive

[ python-Bugs-694812 ] setup.py imports pwd before it's built if HOME not set
Bugs item #694812, was opened at 2003-02-28 03:55
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=694812&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: Stephan A. Terre (sfiedler)
Assigned to: Nobody/Anonymous (nobody)
Summary: setup.py imports pwd before it's built if HOME not set

Initial Comment:
The function check_environ in Lib/distutils/util.py
imports the 'pwd' module if the HOME environment
variable is not set and os.name is 'posix' (as it is on
at least Linux, Solaris, and Tru64 Unix). In the
context of building Python, this happens before the pwd
module has been built. The error is reproduced below.

I can work around this easily. However, since the error
message was somewhat oblique, it was confusing to
diagnose. Perhaps there's some way to improve the
diagnostic if the underlying problem cannot be fixed.

case $MAKEFLAGS in *-s*) CC='cc' LDSHARED='ld -shared
-expect_unresolved "*"' OPT='-DNDEBUG -O -Olimit 1500'
./python -E ./setup.py -q build;; *) CC='cc'
LDSHARED='ld -shared -expect_unresolved "*"'
OPT='-DNDEBUG -O -Olimit 1500' ./python -E ./setup.py
build;; esac
Traceback (most recent call last):
File "./setup.py", line 795, in ?
main()
File "./setup.py", line 790, in main
scripts = ['Tools/scripts/pydoc']
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/core.py",
line 110, in setup
dist.parse_config_files()
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/dist.py",
line 310, in parse_config_files
filenames = self.find_config_files()
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/dist.py",
line 272, in find_config_files
check_environ()
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/util.py",
line 150, in check_environ
import pwd
ImportError: No module named pwd


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

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-17 19:15

Message:
Logged In: YES
user_id=1188172

Still present in current CVS.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=694812&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[ python-Bugs-694812 ] setup.py imports pwd before it's built if HOME not set [ In reply to ]
Bugs item #694812, was opened at 2003-02-28 03:55
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=694812&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: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Stephan A. Terre (sfiedler)
Assigned to: Nobody/Anonymous (nobody)
Summary: setup.py imports pwd before it's built if HOME not set

Initial Comment:
The function check_environ in Lib/distutils/util.py
imports the 'pwd' module if the HOME environment
variable is not set and os.name is 'posix' (as it is on
at least Linux, Solaris, and Tru64 Unix). In the
context of building Python, this happens before the pwd
module has been built. The error is reproduced below.

I can work around this easily. However, since the error
message was somewhat oblique, it was confusing to
diagnose. Perhaps there's some way to improve the
diagnostic if the underlying problem cannot be fixed.

case $MAKEFLAGS in *-s*) CC='cc' LDSHARED='ld -shared
-expect_unresolved "*"' OPT='-DNDEBUG -O -Olimit 1500'
./python -E ./setup.py -q build;; *) CC='cc'
LDSHARED='ld -shared -expect_unresolved "*"'
OPT='-DNDEBUG -O -Olimit 1500' ./python -E ./setup.py
build;; esac
Traceback (most recent call last):
File "./setup.py", line 795, in ?
main()
File "./setup.py", line 790, in main
scripts = ['Tools/scripts/pydoc']
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/core.py",
line 110, in setup
dist.parse_config_files()
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/dist.py",
line 310, in parse_config_files
filenames = self.find_config_files()
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/dist.py",
line 272, in find_config_files
check_environ()
File
"/usr/var/tmp/sat/xmpy/system/support/build/Python-2.2.2/Lib/distutils/util.py",
line 150, in check_environ
import pwd
ImportError: No module named pwd


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

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-22 08:41

Message:
Logged In: YES
user_id=1188172

Duplicate of #959576.

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

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

Message:
Logged In: YES
user_id=1188172

Still present in current CVS.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=694812&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com