[MacPorts] #55036: py-twisted @17.5.0: Fix email sending bug

MacPorts noreply at macports.org
Sun Oct 8 18:26:57 UTC 2017


#55036: py-twisted @17.5.0: Fix email sending bug
------------------------+---------------------------------
 Reporter:  ryandesign  |      Owner:  MarcusCalhoun-Lopez
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:
 Keywords:  haspatch    |       Port:  py-twisted
------------------------+---------------------------------
 Email fails to send on the MacPorts buildbot installation, at least in
 part because we are using py-twisted 17.5.0 from MacPorts which has an
 email-sending bug:

 {{{
 2017-10-08 17:42:41+0000 [ESMTPSender,client] SMTP Client retrying server.
 Retry: 1
 2017-10-08 17:42:41+0000 [ESMTPSender,client] Unhandled Error
         Traceback (most recent call last):
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/python/log.py", line 103, in callWithLogger
             return callWithContext({"system": lp}, func, *args, **kw)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/python/log.py", line 86, in callWithContext
             return context.call({ILogContext: newCtx}, func, *args, **kw)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/python/context.py", line 122, in callWithContext
             return self.currentContext().callWithContext(ctx, func, *args,
 **kw)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/python/context.py", line 85, in callWithContext
             return func(*args,**kw)
         --- <exception caught here> ---
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/internet/selectreactor.py", line 149, in
 _doReadOrWrite
             why = getattr(selectable, method)()
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/internet/tcp.py", line 208, in doRead
             return self._dataReceived(data)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/internet/tcp.py", line 214, in _dataReceived
             rval = self.protocol.dataReceived(data)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/protocols/tls.py", line 330, in dataReceived
             self._flushReceiveBIO()
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
             ProtocolWrapper.dataReceived(self, bytes)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/protocols/policies.py", line 120, in dataReceived
             self.wrappedProtocol.dataReceived(data)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/protocols/basic.py", line 571, in dataReceived
             why = self.lineReceived(line)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/mail/smtp.py", line 995, in lineReceived
             why = self._okresponse(self.code, b'\n'.join(self.resp))
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/mail/smtp.py", line 1044, in smtpState_to
             return self.smtpState_toOrData(0, b'')
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/mail/smtp.py", line 1062, in smtpState_toOrData
             self.sendLine(b'RCPT TO:' + quoteaddr(self.lastAddress))
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/twisted/mail/smtp.py", line 179, in quoteaddr
             res = email.utils.parseaddr(addr)
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/utils.py",
 line 214, in parseaddr
             addrs = _AddressList(addr).addresslist
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/_parseaddr.py",
 line 457, in __init__
             self.addresslist = self.getaddrlist()
           File
 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/_parseaddr.py",
 line 217, in getaddrlist
             while self.pos < len(self.field):
         exceptions.TypeError: object of type 'module' has no len()

 }}}

 Here is the upstream ticket: https://twistedmatrix.com/trac/ticket/9180

 That server is down for me at the moment, but here is the fix upstream
 committed:
 https://github.com/twisted/twisted/commit/5ddbe39695f65e2cd485c997fe2af7afdfe4b751

 Most of that commit is irrelevant; we probably only need the one-character
 change changing `email` to `_email`. See attached patches.

 Alternately, you could update py-twisted to 17.9.0 which includes this
 fix.

--
Ticket URL: <https://trac.macports.org/ticket/55036>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list