suds-community / suds

Suds is a lightweight SOAP python client for consuming Web Services. A community fork of the jurko fork.
https://suds.readthedocs.io/
GNU Lesser General Public License v3.0
172 stars 54 forks source link

nonempty __slots__ not supported for subtype of 'str' TypeError: Error when calling the metaclass bases #70

Closed emezeta closed 2 years ago

emezeta commented 2 years ago

Hi guys, I know it's a pain ... I already see #68 :( After a while of poking around on the net, I found out that this is a very old discussion. Since none of the tips I found have worked for me, I'm leaving the question here to see if anyone can throw me a line of help.

pip2 install suds Downloading/unpacking suds Downloading suds-1.0.0.tar.gz (283kB): 283kB downloaded

my code is silly simple and runs smoothly from a python 2.7.9 prompt:

from suds.client import Client
client = Client(ws_url)

res = client.service.remote_method(...)

The error comes when you call the function where this code live.

    from suds.sax.text import Text
  File "/usr/local/lib/python2.7/dist-packages/suds/sax/text.py", line 25, in <module>
    class Text(str):
TypeError: Error when calling the metaclass bases
    nonempty __slots__ not supported for subtype of 'str'

It is a legacy erp application that I cannot upgrade to py3. Thanks you guys in advance. Marcelo

emezeta commented 2 years ago

Hi, I understood that it'll be healthier to split the approach into two different python versions. An external call - maybe subprocess - from the ERP.py2 to the script.py3 in which suds interacts with the WS. Sorry for the noise! I close this topic now.

phillbaker commented 2 years ago

👋 unfortunately this is due to the change in https://github.com/suds-community/suds/pull/58/ to move from subclassing unicode to subclassing str, which is part of natively supporting python 3.

Please note that suds-community v0.8.5 fully supports python 2.7, my recommendation would be to pin to that version.

emezeta commented 2 years ago

is running fine with subprocess now, but naturally it will be easier and cleaner without such version mixing. Thanks a lot for the tip