Opened 5 years ago

Closed 5 years ago

#3194 closed defect (fixed)

build.getResponsibleUsers() returns None when sending mail

Reported by: daniel@… Owned by:
Priority: major Milestone: 0.9.0
Version: master Keywords: mail, buildstep


When using MailNotifier? like this:

mn = status.MailNotifier(fromaddr=“",
                         relayhost="", smtpPort=587,
c['status'] = []

I get this exception:

2015-02-05 10:18:35+0100 [-] Exception caught notifying <buildbot.status.mail.MailNotifier object at 0x10f2d33d0> of buildFinished event
2015-02-05 10:18:35+0100 [-] Unhandled Error
	Traceback (most recent call last):
	  File "/Library/Python/2.7/site-packages/buildbot-0.9.0-py2.7.egg/buildbot/status/", line 267, in buildFinished
	  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/", line 382, in callback
	  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/", line 490, in _startRunCallbacks
	  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/", line 577, in _runCallbacks
	    current.result = callback(current.result, *args, **kw)
	--- <exception caught here> ---
	  File "/Library/Python/2.7/site-packages/buildbot-0.9.0-py2.7.egg/buildbot/status/", line 582, in _buildFinished
	    w.buildFinished(name, s, results)
	  File "/Library/Python/2.7/site-packages/buildbot-0.9.0-py2.7.egg/buildbot/status/", line 554, in buildFinished
	    return self.buildMessage(name, [build], results)
	  File "/Library/Python/2.7/site-packages/buildbot-0.9.0-py2.7.egg/buildbot/status/", line 752, in buildMessage
	    build=build, results=build.results)
	  File "/Library/Python/2.7/site-packages/buildbot-0.9.0-py2.7.egg/buildbot/status/", line 733, in buildMessageDict
	  File "/Library/Python/2.7/site-packages/buildbot-0.9.0-py2.7.egg/buildbot/status/", line 212, in defaultMessage
	    text += "Blamelist: %s\n" % ",".join(build.getResponsibleUsers())
	exceptions.TypeError: sequence item 0: expected string, NoneType

This happens when I get changes from a Git repository. I'm currently using PBChangeSource() and the contrib/ to get a notification from Github. I don't think that is related though and GitPoller? should give the same behaviour.

Change History (7)

comment:1 Changed 5 years ago by daniel@…

So I spent some time looking at this issue and the problem is at this line:

The problem here is that even if source.patch_info set source.path_info[0] is None which in my test case results in this list

[None, user <email>]

I'm unsure how to fix this bug though. Adding a check here is easy but I figured that the real issues may be somewhere else in the code (that sets patch_info)

comment:2 Changed 5 years ago by daniel@…

  • Keywords buildstep added

comment:3 Changed 5 years ago by daniel@…

I have made some more investigation and these lines

ss.patch = None
ss.patch_info = (None, None)

It looks like patch_info is always set which means the check in is incorrect and the check should really be if patch is None and not check the patch_info

comment:4 Changed 5 years ago by dustin

  • Keywords osx removed
  • Milestone changed from undecided to 0.9.0
  • Type changed from undecided to defect

Sounds like you've found the problem -- want to make a patch?

comment:6 Changed 5 years ago by daniel@…

Yeah. I see you found the patch :)

I need someone to comment on my comment though as I think there is an issue with the test as compared to how the code is implemented.

comment:7 Changed 5 years ago by dustin

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.