Skip to content

Dependency on isodate seems to clash with Python 3.6 (NameError: name 'long' is not defined) #548

Open
@chriswue

Description

@chriswue

Using zeep 2.3.0 and python 3.6.2 amd64. Platform is Windows 8.1 64bit

When connecting to our service the parsing of the WSDL fails with:

  File "site-packages\zeep\client.py", line 41, in __call__
  File "site-packages\zeep\wsdl\bindings\soap.py", line 121, in send
  File "site-packages\zeep\wsdl\bindings\soap.py", line 185, in process_reply
  File "site-packages\zeep\wsdl\bindings\soap.py", line 363, in process_reply
  File "site-packages\zeep\wsdl\messages\soap.py", line 90, in deserialize
  File "site-packages\zeep\wsdl\messages\soap.py", line 408, in _deserialize_body
  File "site-packages\zeep\xsd\elements\element.py", line 114, in parse
  File "site-packages\zeep\xsd\types\complex.py", line 169, in parse_xmlelement
  File "site-packages\zeep\xsd\elements\indicators.py", line 600, in parse_xmlelements
  File "site-packages\zeep\xsd\elements\element.py", line 160, in parse_xmlelements
  File "site-packages\zeep\xsd\elements\element.py", line 114, in parse
  File "site-packages\zeep\xsd\types\complex.py", line 169, in parse_xmlelement
  File "site-packages\zeep\xsd\elements\indicators.py", line 600, in parse_xmlelements
  File "site-packages\zeep\xsd\elements\element.py", line 160, in parse_xmlelements
  File "site-packages\zeep\xsd\elements\element.py", line 114, in parse
  File "site-packages\zeep\xsd\types\complex.py", line 169, in parse_xmlelement
  File "site-packages\zeep\xsd\elements\indicators.py", line 600, in parse_xmlelements
  File "site-packages\zeep\xsd\elements\element.py", line 160, in parse_xmlelements
  File "site-packages\zeep\xsd\elements\element.py", line 114, in parse
  File "site-packages\zeep\xsd\types\simple.py", line 61, in parse_xmlelement
  File "site-packages\zeep\xsd\types\builtins.py", line 141, in pythonvalue
  File "site-packages\isodate\isodatetime.py", line 56, in parse_datetime
  File "site-packages\isodate\isotime.py", line 128, in parse_time
NameError: name 'long' is not defined

It works fine on python 3.5 but our script makes use of 3.6 features so running 3.5 isn't an option.

The root cause of the problem is that the isodate package makes use of a couple of long expressions and long no longer exists in Python 3.x. If I get the history right this was done in 3.3 so as far as I can see it should have failed in 3.5 as well but maybe they just deprecated it and finally removed the long keyword in 3.6, couldn't find anything specific.

I managed to fix it for me by downloading the isodate source code and fixing the isotime.py by replacing long with int.

Now to the crux: isodate is dead as far as I can see, last update was 2 years ago and official support stops with python 3.4. So maybe the dependency should be removed from zeep? Not sure if in python 3.6 datetime is sufficient, but an alternative could be https://pypi.python.org/pypi/iso8601

Actually to add to this: Just found the github repo for isodate and the current tip has this fixed, just the last pip package is 0.5.4 which is broken.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions