views:

43

answers:

3

I am trying to use Tarek Ziadé's Trac buildout recipe from PyPi (and his book 'Expert Python Programming', which I don't have access to.)

It worked fine the first time round, however upon creating a new (Python 2.6 virtualenv) environment I got the following error on buildout.

File "/usr/local/Plone/buildout-cache/eggs/pbp.recipe.trac-0.2.3-py2.6.egg/pbp/recipe/trac/__init__.py", line 59, in install
    milestone_list = [m.name for m in Milestone.select(trac.env_open())]

AttributeError: TracAdmin instance has no attribute 'env_open'

Sure enough, if i insert a pdb.set_trace() before line 59 and introspect trac then I can see there is no env_open attribute (although there is env_set, env_check etc).

The one time it did work was in a very messy development environment that already had one (non buildout) Trac instance set up and had been built with sudo permissions (the newer environment has normal permissions).

I'm at a loss as to why this is happening, although, based on the above, it feels like the recipe is trying to open a trac instance that doesnt exist yet or it can't access?

A: 

The error appears to be caused by a change made between Trac 0.11 and 0.12.

Setting the following in the buildout file, will result in a successful build.

[buildout]
versions = versions
parts = trac
index = http://pypi.python.org/simple

[versions]
Trac = 0.11

[trac]
etc....

However, I will leave the question open, as I would like the buildout to eventually work with 0.12 too.

Jon Hadley
A: 

FYI, I've recently updated the pbp.recipe.trac recipe to have full support of Trac 0.11. See: http://pypi.python.org/pypi/pbp.recipe.trac/0.3.0 .

Trac 0.12 support is coming soon. Tests, feature requests and contributions are welcomed ! :)

Kevin Deldycke