OpenERP buildout recipe

startup script uses PYTHONPATH instead of sys.path

Reported by Georges Racinet on 2012-03-20
This bug report is a duplicate of:  Bug #1019886: Install openerp as a normal package. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP buildout recipe
Undecided
Unassigned

Bug Description

The openerp startup script created by the recipe sets the path through the PYTHONPATH environment variable.

This is less robust than the sys.path hacking done by other recipes : IIRC PYTHONPATH is interpreted in site.py, and some linux distros (I've seen it on Debian Etch, don't know if it's still current) may ignore it or have the global site-packages (dist-packages for Debian) take precedence over it, which breaks the reproducibility of the buildout.

Also, creating python startups open the road to more flexibility. An example : a startup scripts for tests may want to load a cheatable datetime implementation.

Georges Racinet (gracinet) wrote :

update: I made the PYTHONPATH test on Debian Squeeze, and PYTHONPATH now has precedence.
That doesn't change the fact that sys.path setting is a better warranty and the above mentionned flexibility

Georges Racinet (gracinet) wrote :

After a bit of investigation, I conclude that the best is to use a custom interpreter to launch openerp.
Reasons:

 - the startup script of openerp 6.1 is not modular enough yet (the if __name__ part does not relay to a single callable). Therefore, simply doing as for console_scripts would not work right away (or would lead us to unwanted code duplication) ;
- we want to support from 6.0 up anyway, and the custom interpreter can bring the kind of uniformity we need.

This can be done by giving the 'interpreter' option a default value.

Georges Racinet (gracinet) wrote :

pushed experiment following the above lines in this issue's related branch

Changed in anybox.recipe.openerp:
status: New → In Progress
Georges Racinet (gracinet) wrote :

For OpenERP >= 6.1, the work done in this branch is now deprecated by the better solution done for #1019886

Georges Racinet (gracinet) wrote :

Now obsolete in all supported cases, unlinked the experimental branch

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers