Ticket #352 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

buildbot.process.buildstep.RemoteShellCommand.__repr__ fails if command is a tuple with length not equal to 1

Reported by: exarkun Owned by:
Priority: major Milestone: 0.7.10
Version: 0.7.9 Keywords:
Cc:

Description

This code:

    def __repr__(self):
        return "<RemoteShellCommand '%s'>" % self.command

raises a TypeError if self.command is a tuple with length not equal to 1. It's probably risky to ever use the non-tuple form of string interpolation with a right hand argument that was given to you by someone else (ie, that you're not sure is exactly what you think it is).

Change History

comment:1 Changed 4 years ago by dustin

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from undecided to 0.7.10

Agreed, and I just pulled rbosetti's patch to fix this.

comment:2 Changed 4 years ago by dustin

From 155e6f5d58b44a803a4b36287b8cdff19529c26f Mon Sep 17 00:00:00 2001
From: rlb <rbosetti+gh@gmail.com>
Date: Mon, 26 Jan 2009 21:06:18 -0800
Subject: [PATCH] Fix repr for RemoteShellCommand. fixes #352

New testcase in test_buildstep.py, runs each case for repr
---
 buildbot/process/buildstep.py   |    2 +-
 buildbot/test/test_buildstep.py |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
Note: See TracTickets for help on using tickets.