[Bug 1200269] Re: str(suds.sax.document.Document()) raises exception

James Page james.page at ubuntu.com
Tue Oct 24 09:14:08 UTC 2017


I did a quick check on with the latest suds package in Ubuntu, and this
issue is resolved:

$ python
Python 2.7.14 (default, Sep 23 2017, 22:06:14) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from suds.sax import document
>>> str(document.Document())
'<?xml version="1.0" encoding="UTF-8"?>'
>>> 

Marking Fix Released.


** Changed in: suds (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to suds in Ubuntu.
https://bugs.launchpad.net/bugs/1200269

Title:
  str(suds.sax.document.Document()) raises exception

Status in suds package in Ubuntu:
  Fix Released

Bug description:
  If the Document object is created without a root element, its
  overridden version of __str__ throws an exception.

  I encountered this bug with an interaction between the django debug
  toolbar and suds. In suds's suds.mx.core.append method, log.debug()
  can be called with a Document that has no children. Django's debug
  toolbar calls str() on the arguments to debug(), which causes the
  exception to be raised.

  Reproduce:
  import suds
  str(suds.sax.document.Document())

  Fix:
  replace str and plain definitions in suds.sax.document.Document with the code below:
  def str(self):
      s = []
      s.append(self.DECL)
      s.append('\n')
      root = self.root()
      if root is not None:
          s.append(root.str())
      return ''.join(s)

  def plain(self):
      s = []
      s.append(self.DECL)
      root = self.root()
      if root is not None:
          s.append(root.plain())
      return ''.join(s)

  Affects:
  All versions of Ubuntu, all versions of suds

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/suds/+bug/1200269/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list