zc.recipe.egg:custom traps on environment variables with embedded % signs

Bug #1261686 reported by Gottfried Ganßauge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Buildout
New
Undecided
Unassigned

Bug Description

On my machine (OpenSuse-12.3) the system sets up two environment variables
"LESSOPEN=less_open.sh %s" and
"LESSCLOSE=lessclose.sh %s %s"

I have a buildout.cfg like follows:

[buildout]
parts = pytrs

[pytrs-env]
recipe = collective.recipe.environment

[pytrs]
recipe = zc.recipe.egg:custom
environment = pytrs-env
egg = haufe.pytrs

When run with bin/buildout install egg it generates the following backtrace:

(gotti@manta 1232) bin/buildout install pytrs
Installing pytrs.
While:
  Installing pytrs.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/home/gotti/source/zope-2.13/aurora-python.config/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1805, in main
    getattr(buildout, command)(args)
  File "/home/gotti/source/zope-2.13/aurora-python.config/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 584, in install
    installed_files = self[part]._call(recipe.install)
  File "/home/gotti/source/zope-2.13/aurora-python.config/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1297, in _call
    return f()
  File "/home/gotti/source/zope-2.13/aurora-python.config/eggs/zc.recipe.egg-2.0.1-py2.7.egg/zc/recipe/egg/custom.py", line 88, in install
    self._set_environment()
  File "/home/gotti/source/zope-2.13/aurora-python.config/eggs/zc.recipe.egg-2.0.1-py2.7.egg/zc/recipe/egg/custom.py", line 107, in _set_environment
    os.environ[key] = value % os.environ
TypeError: not enough arguments for format string
(gotti@manta 1233)

I think this should not kill the buildout but should instead print a warning an continue without further trying to interpolate anything on that specific value.

Revision history for this message
Gottfried Ganßauge (gottfried-ganssauge-h) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.