hbldh / pybankid

BankID Relying Party client for Python
https://pybankid.readthedocs.io
MIT License
48 stars 19 forks source link

SUDS use not working in Python 2.6 #3

Closed hbldh closed 7 years ago

hbldh commented 9 years ago

Testing on Travis CI yielded error when using Python 2.6 interpreter. Needs fixing.

======================================================================
ERROR: tests.test_client.TestClientOnTestServer.test_authentication_and_collect
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/hbldh/pybankid/tests/test_client.py", line 99, in test_authentication_and_collect
    c = bankid.client.BankIDClient(certificates=(self.certificate_file, self.key_file), test_server=True)
  File "/home/travis/build/hbldh/pybankid/bankid/client.py", line 58, in __init__
    headers=headers, transport=t)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/client.py", line 112, in __init__
    self.wsdl = reader.open(url)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/reader.py", line 152, in open
    d = self.fn(url, self.options)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/wsdl.py", line 136, in __init__
    d = reader.open(url)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/reader.py", line 79, in open
    d = self.download(url)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/reader.py", line 101, in download
    return sax.parse(string=content)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/sax/parser.py", line 136, in parse
    sax.parse(source)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/expatreader.py", line 211, in feed
    self._err_handler.fatalError(exc)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/handler.py", line 38, in fatalError
    raise exception
SAXParseException: <unknown>:1:1: not well-formed (invalid token)
hbldh commented 9 years ago

After change to suds-jurko the Python 2.6 error persists.

Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/hbldh/pybankid/tests/test_client.py", line 90, in test_authentication_and_collect
    c = bankid.client.BankIDClient(certificates=(self.certificate_file, self.key_file), test_server=True)
  File "/home/travis/build/hbldh/pybankid/bankid/client.py", line 58, in __init__
    headers=headers, transport=t)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/client.py", line 115, in __init__
    self.wsdl = reader.open(url)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/reader.py", line 150, in open
    d = self.fn(url, self.options)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/wsdl.py", line 136, in __init__
    d = reader.open(url)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/reader.py", line 74, in open
    d = self.download(url)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/reader.py", line 100, in download
    return sax.parse(string=content)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/suds/sax/parser.py", line 133, in parse
    sax.parse(source)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/expatreader.py", line 211, in feed
    self._err_handler.fatalError(exc)
  File "/opt/python/2.6.9/lib/python2.6/xml/sax/handler.py", line 38, in fatalError
    raise exception
SAXParseException: <unknown>:1:1: not well-formed (invalid token)
hbldh commented 7 years ago

Somehow, this problem has resolved itself. Don't know where, but tests pass on Python 2.6 now.