Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 encode added #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion suds/wsse.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def setnonce(self, text=None):
s.append(self.password)
s.append(Token.sysdate())
m = md5()
m.update(':'.join(s))
m.update(':'.join(s).encode("UTF-8"))
self.nonce = m.hexdigest()
else:
self.nonce = text
Expand Down
16 changes: 10 additions & 6 deletions suds/xsd/sxbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def __init__(self, schema, root):
self.qname = (self.name, schema.tns[1])
self.min = root.get('minOccurs')
self.max = root.get('maxOccurs')
self.totalDigits = None
if root.getChild('restriction'):
if root.getChild('restriction').getChild('totalDigits') is not None:
self.totalDigits = root.getChild('restriction').getChild('totalDigits').get('value')
self.type = root.get('type')
self.ref = root.get('ref')
self.form_qualified = schema.form_qualified
Expand Down Expand Up @@ -463,7 +467,7 @@ def description(self):
return ()

def __unicode__(self):
return unicode(self.str())
return str(self.str())

def __repr__(self):
s = []
Expand Down Expand Up @@ -520,7 +524,7 @@ def __init__(self, sx):
self.items = sx.rawchildren
self.index = 0

def next(self):
def __next__(self):
"""
Get the I{next} item in the frame's collection.
@return: The next item or None
Expand Down Expand Up @@ -571,7 +575,7 @@ def top(self):
else:
raise StopIteration()

def next(self):
def __next__(self):
"""
Get the next item.
@return: A tuple: the next (child, ancestry).
Expand All @@ -580,15 +584,15 @@ def next(self):
"""
frame = self.top()
while True:
result = frame.next()
result = next(frame)
if result is None:
self.pop()
return self.next()
return next(self)
if isinstance(result, Content):
ancestry = [f.sx for f in self.stack]
return result, ancestry
self.push(result)
return self.next()
return next(self)

def __iter__(self):
return self
Expand Down
4 changes: 2 additions & 2 deletions suds/xsd/sxbasic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from suds.sax import Namespace
from suds.transport import TransportError
from suds.reader import DocumentReader
from urlparse import urljoin
from urllib.parse import urljoin

from logging import getLogger
log = getLogger(__name__)
Expand Down Expand Up @@ -670,7 +670,7 @@ def __applytns(self, root):
root.set(TNS, tns)
else:
if self.schema.tns[1] != tns:
raise Exception, '%s mismatch' % TNS
raise Exception('%s mismatch' % TNS)


def description(self):
Expand Down