Opened 6 years ago

Last modified 6 years ago

#2891 new defect

Exception when using Interpolate in description

Reported by: sa2ajj Owned by:
Priority: major Milestone: 0.8.x
Version: 0.8.9 Keywords:


Per discussion at IRC:

This step:

                command=['cmd', 'param', ..., 'param'],
        #description=Interpolate("configure %(prop:Environment)s"),
        description="configure the new environment",
        doStepIf=lambda step:"state") == "present"

causes an exception

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/", line 1155, in gotResult
    _inlineCallbacks(r, g, deferred)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/", line 1142, in _inlineCallbacks
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/", line 382, in callback
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/", line 490, in _startRunCallbacks
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/", line 577, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/buildbot/process/", line 653, in _gotResults
    self.setStatus(cmd, results)
  File "/usr/local/lib/python2.7/dist-packages/buildbot/process/", line 739, in setStatus
    self._step_status.setText(self.getText(cmd, results))
  File "/usr/local/lib/python2.7/dist-packages/buildbot/process/", line 716, in getText
    return self.describe(True) + ["failed"]
exceptions.TypeError: coercing to Unicode: need string or buffer, list found

Change History (6)

comment:1 Changed 6 years ago by sa2ajj

After a bit of code reading and thinking, it looks like this little snippet gives the same outcome:

a = u'Hello'
b = a + ['world']
Last edited 6 years ago by sa2ajj (previous) (diff)

comment:2 Changed 6 years ago by sa2ajj

So documentation gives examples when all the fields are lists of "small strings".

Probably some sanity check for the parameters need to be implemented.

comment:4 Changed 6 years ago by sa2ajj

(Sorry, the code link above was incorrect for master.)

comment:5 Changed 6 years ago by dustin

That pull req was invalid: description, descriptionDone, and descriptionSuffix can be lists or strings.

So I think the bug is that ShellCommand.describe is not returning a list. This is all getting rewritten as part of #2818, so the remaining fix here is eight-only. And the workaround is just to add .. to the description parameter.

comment:6 Changed 6 years ago by dustin

  • Milestone changed from 0.9.+ to 0.8.x
Note: See TracTickets for help on using tickets.