Build error Python 2.4.1 - stat problem?

G

Guest

Hello,

I tried to build Python 2.4.1 on a Reliant Unix system. Just after the
python executable program has been built, I get the following error:

==== begin make output ===
CC -W1 -Blargedynsym -o python \
Modules/python.o \
libpython2.4.a -lresolv -lsocket -lnsl -ldl
-lm
case $MAKEFLAGS in \
*-s*) CC='cc' LDSHARED='ld' OPT='-DNDEBUG -O' ./python -E
../setup.py -q build;; \
*) CC='cc' LDSHARED='ld' OPT='-DNDEBUG -O' ./python -E
../setup.py build;; \
esac
Traceback (most recent call last):
File "./setup.py", line 1088, in ?
class PyBuildInstallLib(install_lib):
File "./setup.py", line 1094, in PyBuildInstallLib
so_ext = sysconfig.get_config_var("SO")
File "/build_dir/Python-2.4.1/Lib/distutils/sysconfig.py", line 511,
in get_config_var
return get_config_vars().get(name)
File "/build_dir/Python-2.4.1/Lib/distutils/sysconfig.py", line 488,
in get_config_vars
func()
File "/build_dir/Python-2.4.1/Lib/distutils/sysconfig.py", line 358,
in _init_posix
raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation:
unable to open /usr/local/lib/python2.4/config/Makefile (No such file or
directory)
make: *** Error code 1

make: Fatal error.
==== end make output ===

It is strange that the Makefile complains about /usr/local/lib/python2.4
since this is still the build phase, far away from the installation into
/usr/local.


I used the python executable from the build directory to run the
following program:

import os

def main():
if not (os.path.exists("/")):
print "/ does not exist"
else:
print "/ exists"
if not (os.path.isdir("/")):
print "/ is not a directory"
else:
print "/ ok"

if __name__ == "__main__":
main()

The output is:

/ exists
/ is not a directory

It's the same for every (existing) directory name I try: os.path.isdir()
always returns false.

It looks as if the stat results are not recognised: os.path.exists()
works, but all the functions os.path.isdir(), os.path.isfile() etc.
don't.

Could anyone help me to solve the problem?

- Servatius
 
D

Donn Cave

I used the python executable from the build directory to run the
following program:

import os

def main():
if not (os.path.exists("/")):
print "/ does not exist"
else:
print "/ exists"
if not (os.path.isdir("/")):
print "/ is not a directory"
else:
print "/ ok"

if name == " main ":
main()

The output is:

/ exists
/ is not a directory

It's the same for every (existing) directory name I try: os.path.isdir()
always returns false.

It looks as if the stat results are not recognised: os.path.exists()
works, but all the functions os.path.isdir(), os.path.isfile() etc.
don't.

Could anyone help me to solve the problem?

Unless there are other Reliant users here ahead of you, some
of it is going to be up to you. If you follow isdir() back,
you'll find some hard-coded octal bitmask definitions, including
S_IFDIR = 0040000.

Check it out. Try to use that value the way they're using it,
in C and in Python, and print out all the values involved.
At worst, if C comes out wrong too, you may have a question
that the vendor will be more likely to respond to.

Donn Cave, (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top