Your message dated Sun, 26 Jul 2020 03:33:30 +0000
with message-id <[email protected]>
and subject line Bug#812324: fixed in pysimplesoap 1.16.2-3
has caused the Debian Bug report #812324,
regarding python-pysimplesoap: Using a list or dict as return of a SOAP method 
let to an error
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
812324: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812324
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-pysimplesoap                                                    
Version: 1.16-1                                                                 
Severity: normal
Tag: patch

Dear Maintainer,

using a list or dict as return of a SOAP method let to an error:
File "pysimplesoap/server.py", line 372, in parse_element
    if v in TYPE_MAP.keys():
        TypeError: unhashable type: 'list'
resp.
File "pysimplesoap/server.py", line 372, in parse_element
    if v in TYPE_MAP.keys():
        TypeError: unhashable type: 'dict'

server:
-------

from pysimplesoap.server import SoapDispatcher, SOAPHandler
from http.server import HTTPServer

def getlist():
    "Return a list"
    return {'list': [{'col': 'A'}, {'col': 'B'}, {'col': 'C'}]}

dispatcher = SoapDispatcher(
    'my_dispatcher',
    location = "http://localhost:8008/";,
    action = 'http://localhost:8008/', # SOAPAction
    namespace = "http://example.com/sample.wsdl";, prefix="ns0",
    trace = True,
    ns = True)

# register the user function
dispatcher.register_function('GetList', getlist,
                             returns = {'list': [{'col': str}]}, args = {})

print ("Starting server...")
httpd = HTTPServer(("", 8008), SOAPHandler)
httpd.dispatcher = dispatcher
httpd.serve_forever()

client:
-------

from suds.client import Client

client = Client ("http://127.0.0.1:8008/";)
result = client.service.GetList ()
print result

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages python-pysimplesoap depends on:
ii  python-httplib2  0.9.1+dfsg-1
ii  python-pycurl    7.21.5-1
pn  python:any       <none>

python-pysimplesoap recommends no packages.

python-pysimplesoap suggests no packages.

-- no debconf information
>From 00fd7b71189996cd5c7769025f8d56fe23156119 Mon Sep 17 00:00:00 2001
From: Benedikt Spranger <[email protected]>
Date: Wed, 20 Jan 2016 16:08:47 +0100
Subject: [PATCH] reorder type check to avoid a TypeError

Using a list or dict as return of a SOAP method let to an error:
File "pysimplesoap/server.py", line 372, in parse_element
    if v in TYPE_MAP.keys():
    TypeError: unhashable type: 'list'

Reoder the type check and add a comment to avoid this error.

Signed-off-by: Benedikt Spranger <[email protected]>
---
 pysimplesoap/server.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Index: pysimplesoap-1.16/pysimplesoap/server.py
===================================================================
--- pysimplesoap-1.16.orig/pysimplesoap/server.py	2016-01-22 11:39:27.400682071 +0100
+++ pysimplesoap-1.16/pysimplesoap/server.py	2016-01-22 11:39:27.396682071 +0100
@@ -369,9 +369,11 @@
                     e['name'] = k
                     if array:
                         e[:] = {'minOccurs': "0", 'maxOccurs': "unbounded"}
-                    if v in TYPE_MAP.keys():
-                        t = 'xsd:%s' % TYPE_MAP[v]
-                    elif v is None:
+
+                    # check list and dict first to avoid
+                    # TypeError: unhashable type: 'list' or
+                    # TypeError: unhashable type: 'dict'
+                    if v is None:
                         t = 'xsd:anyType'
                     elif isinstance(v, list):
                         n = "ArrayOf%s%s" % (name, k)
@@ -384,6 +386,8 @@
                         n = "%s%s" % (name, k)
                         parse_element(n, v.items(), complex=True)
                         t = "tns:%s" % n
+                    elif v in TYPE_MAP.keys():
+                        t = 'xsd:%s' % TYPE_MAP[v]
                     else:
                         raise TypeError("unknonw type v for marshalling" % str(v))
                     e.add_attribute('type', t)

--- End Message ---
--- Begin Message ---
Source: pysimplesoap
Source-Version: 1.16.2-3
Done: Sandro Tosi <[email protected]>

We believe that the bug you reported is fixed in the latest version of
pysimplesoap, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sandro Tosi <[email protected]> (supplier of updated pysimplesoap package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 25 Jul 2020 23:12:59 -0400
Source: pysimplesoap
Architecture: source
Version: 1.16.2-3
Distribution: unstable
Urgency: medium
Maintainer: Sandro Tosi <[email protected]>
Changed-By: Sandro Tosi <[email protected]>
Closes: 812324
Changes:
 pysimplesoap (1.16.2-3) unstable; urgency=medium
 .
   [ Debian Janitor ]
   * Bump debhelper from old 10 to 12.
   * Set upstream metadata fields: Name.
   * Set upstream metadata fields: Bug-Database.
   * Set upstream metadata fields: Bug-Submit.
 .
   [ Bastian Germann ]
   * Avoid TypeError on list/dict (Closes: #812324)
 .
   [ Debian Janitor ]
   * Update standards version to 4.5.0, no changes needed.
 .
   [ Sandro Tosi ]
   * debian/control
     - wrap-and-sort
   * debian/copyright
     - extend packaging copyright years
Checksums-Sha1:
 bef1f3282e02619009520e1a3fed06d4acd516d9 2046 pysimplesoap_1.16.2-3.dsc
 228662e2ca9ca73334efd55f639c02611cc0f33c 5616 
pysimplesoap_1.16.2-3.debian.tar.xz
 c1e989ad037e1133eebd2f84645eb68463cacec7 6357 
pysimplesoap_1.16.2-3_source.buildinfo
Checksums-Sha256:
 7c40141b6e96d3fad70a165e5a3326f801bcf000d1f95c99fbbf48d2ad24cc48 2046 
pysimplesoap_1.16.2-3.dsc
 1c2446e1e59f12bf429c5df4b47769dcc266f8ccb2129e6c1902547afd72d748 5616 
pysimplesoap_1.16.2-3.debian.tar.xz
 a76774697386e4fc2572f9f0cd65fc12729276b084f2c17834fb3f116fec8a9a 6357 
pysimplesoap_1.16.2-3_source.buildinfo
Files:
 eca17dd6385bd17ff8b0779c6fccfa47 2046 python optional pysimplesoap_1.16.2-3.dsc
 91f684e7311e3ea84aaf8363043bf7dc 5616 python optional 
pysimplesoap_1.16.2-3.debian.tar.xz
 fa860ce539983401311865b8ae76aa1b 6357 python optional 
pysimplesoap_1.16.2-3_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEufrTGSrz5KUwnZ05h588mTgBqU8FAl8c9MkACgkQh588mTgB
qU8dfg/9HyTrcp08irmtzZtHLmi9yvLTlowjOT/jE4C0BjdMsHZINYwo8dMJEfGW
My9WtmRG4iOJUhul9hDO5o7qFRMvhKXqVSvCfVRZQnD9tKmx8jXD/wcA7jRH5Em6
PVoLENzuaA2GDo8agcFDnFYPe1vcCi2kOPs/0PhuQmPbnSwow5cvpzjy6gead3YU
TeoTb6U1ocFP5Xz+Vor+WpOMBdlqP27t2ppDHtdoMgNOLDPPd5Hp85pENFj98EUe
UzBKIgQVwZNm5XF6grnNhZIrPRgPG7zrf4vxwV2wrSQz3ZCKEp6pjOT2yKC7RhcR
KofzFSK0StIw4yb/TaxcvgW6C1ACwK65HncoNHy/k+XolvzhaRyPKv/HD8jc1Wc0
vkBnF7W0Dsek2uh4p0RAM/NXstVtq3RhAF+fF3wHv1bk4ZzyvlmIUBJc/zkfBKR5
DyTlRZaii0Qo32U5r8LxWw15pxMB/+NM2a9GRxLWqPrlusWXguSZM6G0wf+X81Jx
xA1qquhJyPBQkicpodsxUpRaKJ4gupsgAHJhGLtqWs4+ib2WyD0/HAPiQ0g0HFVl
ZQb6lFIP2nj88Mcwea18fs8Z0imN9KFg8eBRZ+8eJK2L4L0Ps2+dFTfh/NOoPysc
j1SanKd/VZbGdmjqvWCscnjRgKlg3/xbd9C5VeAH2R1n4iPt6hg=
=N5jv
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to