Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#1881 defect closed duplicate (duplicate)

test_jabbercomponent, test_jabbererror, test_jabberxmlstream, test_msn fail if pyopenssl is not installed.

Reported by: spiv Owned by:
Priority: normal Milestone:
Component: words Keywords:
Cc: spiv, ralphm, Jean-Paul Calderone Branch:
Author:

Description

From http://twistedmatrix.com/buildbot/full-2.5-suse/builds/4/step-shell/2:

===============================================================================
[ERROR]: twisted.words.test.test_jabbercomponent

Traceback (most recent call last):
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/trial/runner.py", line 343, in loadByName
    thing = self.findByName(name)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/trial/runner.py", line 252, in findByName
    return reflect.namedAny(name)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/python/reflect.py", line 352, in namedAny
    topLevelPackage = __import__(trialname)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/test/test_jabbercomponent.py", line 8, in <module>
    from twisted.words.protocols.jabber.component import ConnectComponentAuthenticator
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/protocols/jabber/component.py", line 10, in <module>
    from twisted.words.protocols.jabber import jstrports, xmlstream
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/protocols/jabber/xmlstream.py", line 13, in <module>
    from OpenSSL import SSL
exceptions.ImportError: No module named OpenSSL
===============================================================================
[ERROR]: twisted.words.test.test_jabbererror.StreamErrorTest.testGetElementPlain

Traceback (most recent call last):
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/test/test_jabbererror.py", line 47, in testGetElementPlain
    element = e.getElement()
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/protocols/jabber/error.py", line 90, in getElement
    from twisted.words.protocols.jabber.xmlstream import NS_STREAMS
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/protocols/jabber/xmlstream.py", line 13, in <module>
    from OpenSSL import SSL
exceptions.ImportError: No module named OpenSSL
===============================================================================
[ERROR]: twisted.words.test.test_jabberxmlstream

Traceback (most recent call last):
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/trial/runner.py", line 343, in loadByName
    thing = self.findByName(name)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/trial/runner.py", line 252, in findByName
    return reflect.namedAny(name)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/python/reflect.py", line 352, in namedAny
    topLevelPackage = __import__(trialname)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/test/test_jabberxmlstream.py", line 3, in <module>
    from twisted.words.protocols.jabber import error, xmlstream
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/protocols/jabber/xmlstream.py", line 13, in <module>
    from OpenSSL import SSL
exceptions.ImportError: No module named OpenSSL
===============================================================================
[ERROR]: twisted.words.test.test_msn

Traceback (most recent call last):
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/trial/runner.py", line 343, in loadByName
    thing = self.findByName(name)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/trial/runner.py", line 252, in findByName
    return reflect.namedAny(name)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/python/reflect.py", line 352, in namedAny
    topLevelPackage = __import__(trialname)
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/test/test_msn.py", line 24, in <module>
    from twisted.words.protocols import msn
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/words/protocols/msn.py", line 85, in <module>
    from twisted.internet.ssl import ClientContextFactory
  File "/home/scmikes/twistedbuildbot/bot-scmikes-2.5/Twisted/twisted/internet/ssl.py", line 47, in <module>
    from OpenSSL import SSL
exceptions.ImportError: No module named OpenSSL
-------------------------------------------------------------------------------

At worst, the tests should be skipped, rather than failing.

Even better, only tests that actually need the OpenSSL module should be skipped, and the others should still run.

Change History (5)

comment:1 Changed 11 years ago by ralphm

Cc: spiv ralphm Jean-Paul Calderone added

twisted.words.protocols.jabber.xmlstream imports the twisted.internet.ssl module and I think it used to be proper to first try importing OpenSSL.SSL.

I see the 'proper' procedure for importing the ssl module is now somewhat more involved, and I can update the xmlstream module to match. I could also only import this when trying to use the TLS. Would that be better?

comment:2 Changed 11 years ago by Jean-Paul Calderone

I am not going to fix this until there is a buildslave set up to test the behavior of Twisted in the absence of PyOpenSSL.

comment:3 Changed 9 years ago by Jean-Paul Calderone

Resolution: duplicate
Status: newclosed

Apparently someone else fixed the jabber issues in some other ticket. The msn issues are in progress in #3111.

comment:4 Changed 9 years ago by ralphm

Ah yes, this was fixed for the Jabber bits as part of #2171.

comment:5 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.