diff --git a/CHANGES.txt b/CHANGES.txt index 11af2c2..c5f921c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,7 +3,7 @@ CHANGELOG 0.12.6 (unreleased) ----------------------- -- Nothing changed yet +- Remove dependency on fpconst. 0.12.5 (2011-08-01) ------------------- diff --git a/README.txt b/README.txt index bf52985..6a30555 100644 --- a/README.txt +++ b/README.txt @@ -123,8 +123,6 @@ USING GITHUB REQUIRED PACKAGES ------------------ - - fpconst 0.6.0 or later, - - wstools diff --git a/setup.py b/setup.py index 5b95fa7..9574a20 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,6 @@ setup( package_dir = {'': 'src'}, include_package_data=True, install_requires=[ - 'fpconst', 'wstools', ] ) diff --git a/src/SOAPpy/Client.py b/src/SOAPpy/Client.py index c073c53..26235f6 100644 --- a/src/SOAPpy/Client.py +++ b/src/SOAPpy/Client.py @@ -223,7 +223,7 @@ class HTTPTransport: # if user is not a user:passwd format # we'll receive a failure from the server. . .I guess (??) if addr.user != None: - val = base64.encodestring(addr.user) + val = base64.encodestring(urllib.unquote_plus(addr.user)) r.putheader('Authorization','Basic ' + val.replace('\012','')) # This fixes sending either "" or "None" @@ -283,13 +283,17 @@ class HTTPTransport: except: message_len = -1 + f = r.getfile() + if f is None: + raise HTTPError(code, "Empty response from server\nCode: %s\nHeaders: %s" % (msg, headers)) + if message_len < 0: # Content-Length missing or invalid; just read the whole socket # This won't work with HTTP/1.1 chunked encoding - data = r.getfile().read() + data = f.read() message_len = len(data) else: - data = r.getfile().read(message_len) + data = f.read(message_len) if(config.debug): print "code=",code diff --git a/src/SOAPpy/Parser.py b/src/SOAPpy/Parser.py index 93da26e..a3127f2 100644 --- a/src/SOAPpy/Parser.py +++ b/src/SOAPpy/Parser.py @@ -5,7 +5,6 @@ from NS import NS from Utilities import * import string -import fpconst import xml.sax from wstools.XMLname import fromXMLname @@ -909,22 +908,22 @@ class SOAPParser(xml.sax.handler.ContentHandler): # Explicitly check for NaN and Infinities if s == "nan": - d = fpconst.NaN + d = NaN elif s[0:2]=="inf" or s[0:3]=="+inf": - d = fpconst.PosInf + d = PosInf elif s[0:3] == "-inf": - d = fpconst.NegInf + d = NegInf else : d = float(s) if config.strict_range: - if fpconst.isNaN(d): + if NaN == d: if s[0:2] != 'nan': raise ValueError, "invalid %s: %s" % (t[1], s) - elif fpconst.isNegInf(d): + elif NegInf == d: if s[0:3] != '-inf': raise UnderflowError, "%s too small: %s" % (t[1], s) - elif fpconst.isPosInf(d): + elif PosInf == d: if s[0:2] != 'inf' and s[0:3] != '+inf': raise OverflowError, "%s too large: %s" % (t[1], s) elif d < 0 and d < l[1]: diff --git a/src/SOAPpy/SOAPBuilder.py b/src/SOAPpy/SOAPBuilder.py old mode 100755 new mode 100644 index 1ed8a16..2f8f392 --- a/src/SOAPpy/SOAPBuilder.py +++ b/src/SOAPpy/SOAPBuilder.py @@ -38,7 +38,6 @@ from version import __version__ import cgi from wstools.XMLname import toXMLname, fromXMLname -import fpconst # SOAPpy modules from Config import Config @@ -333,11 +332,11 @@ class SOAPBuilder: if Config.strict_range: doubleType(obj) - if fpconst.isPosInf(obj): + if PosInf == obj: obj = "INF" - elif fpconst.isNegInf(obj): + elif NegInf == obj: obj = "-INF" - elif fpconst.isNaN(obj): + elif NaN == obj: obj = "NaN" else: obj = repr(obj) diff --git a/src/SOAPpy/Types.py b/src/SOAPpy/Types.py index 26fd0ca..c244509 100644 --- a/src/SOAPpy/Types.py +++ b/src/SOAPpy/Types.py @@ -53,6 +53,10 @@ from NS import NS from Utilities import encodeHexString, cleanDate from Config import Config +NaN = float('NaN') +PosInf = float('Inf') +NegInf = -PosInf + ############################################################################### # Utility functions ###############################################################################