[Buildbot-commits] [Buildbot] #2330: Mail Notifier python error in twisted file "unbound method._init_(.."

Buildbot nobody at buildbot.net
Thu Jul 19 08:57:42 UTC 2012


#2330: Mail Notifier python error in twisted file "unbound method._init_(.."
--------------------+--------------------------
Reporter:  saqub01  |      Owner:  ssa
    Type:  defect   |     Status:  new
Priority:  major    |  Milestone:  undecided
 Version:  0.8.6p1  |   Keywords:  mailnotifier
--------------------+--------------------------
 I am a completely new user to Python and BuildBot. Currently I am using an
 e-mail alert when the BuildBot build status changes (moves from success to
 fail, or vice versa), and failing will e-mail every time there is a failed
 build. I am encountering the following Python error when sending an email
 is attempted.

 --- <exception caught here> ---
 **ESMTPClient.__init__(self, secret, contextFactory, *args, **kw)
 exceptions.TypeError?: unbound method init() must be called with
 ESMTPClient
 instance as first argument (got ESMTPSender instance instead)**

 I have found some examples of this error online when searching for an
 answer, including

     You just need to pass 'self' as an argument to 'Thread.init' and
 calling the super class

 but I am still unsure why there is an error. I would appreciate any
 guidance/help on why this error has occurred and how to go about resolving
 the issue. I am not the author of this code so I am unsure of what to be
 looking for to solve the problem.

 The email was working before the following code was changed from gmail
 account to company account.

           c['status'].append(mail.MailNotifier(
                  fromaddr="load.builder at company.co.uk",
                  extraRecipients=["example at company.com",
                       ],
                  sendToInterestedUsers=False,
                  mode=('change', 'failing'),
                  relayhost="smtp.company.lan",
                  useTls=True,
                  smtpUser="lbuilder",
                  smtpPassword="password"))

 Here's the block of code producing the exception:

 class ESMTPSender(SenderMixin, ESMTPClient):
     requireAuthentication = True
     requireTransportSecurity = True
     def __init__(self, username, secret, contextFactory=None, *args,
 **kw):
         self.heloFallback = 0
         self.username = username

         if contextFactory is None:
              contextFactory = self._getContextFactory()

         ESMTPClient.__init__(self, secret, contextFactory, *args, **kw)
         self._registerAuthenticators()

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2330>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list