[Zope] Zope 2.10b2 build issue

Pascal Peregrina Pperegrina at Lastminute.com
Thu Sep 21 06:26:17 EDT 2006


Again, if you read my hack in my initial mail, you'll see that the issue is
with the python path (I run make in a temporary "build" directory and the
untared Zope source is elsewhere)... So no, my source file is NOT
corrupted...

Let me explain again. In setup.py there is this (nasty) code:
sys.path.insert(0, 'inst')
import versions
del sys.path[0]

In my case, this fails because the "inst" directory is not a subdirectory of
my temporary "build" directory.

So if I fix the path to "inst" with this in setup.py (I copy/pasted this
code from one of my own python scripts):

try:
    MAKEFILEDIR = os.path.dirname(os.path.abspath(__file__))
except:
    MAKEFILEDIR = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.insert(0, '%s/inst'%MAKEFILEDIR)
import versions
del sys.path[0]

...it works fine.

Does it make sense now?

This (nasty) code in setup.py does not exist in Zope 2.8.4


Pascal


> De : Andreas Jung <lists at zopyx.com>
> Répondre à : Andreas Jung <lists at zopyx.com>
> Date : Thu, 21 Sep 2006 12:02:00 +0200
> À : Pascal Peregrina <Pperegrina at Lastminute.com>, Andreas Jung
> <lists at zopyx.com>, <zope at zope.org>
> Objet : Re: [Zope] Zope 2.10b2 build issue
> 
> 
> 
> --On 21. September 2006 11:58:29 +0200 Pascal Peregrina
> <Pperegrina at Lastminute.com> wrote:
> -final/build-b
>> ase /python-2.4/build-temp"
>> Traceback (most recent call last):
>>   File "/opt/pperegri/F2BUILDS/F2.15/src/Zope-2.9.4-final/setup.py", line
>> 53, in ?
>>     import versions
>> ImportError: No module named versions
>> make: *** [build] Error 1
>> 
>> And my exact same hack as initially described works there too.
>> The faulty code does not look very "clean" anyway (playing with the
>> sys.path just to import the versions module)
>> 
> 
> Check if you have "inst/versions.py". If not then you're archive is broken
> or you have a problem with extracting the archive. Ensure you're using
> a *very* recent version of GNU TAR.
> 
> -aj



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


More information about the Zope mailing list