diff --git a/src/zeep/xsd/types/builtins.py b/src/zeep/xsd/types/builtins.py index 18b9a66f..9ab771f8 100644 --- a/src/zeep/xsd/types/builtins.py +++ b/src/zeep/xsd/types/builtins.py @@ -210,7 +210,19 @@ def xmlvalue(self, value): @treat_whitespace("collapse") def pythonvalue(self, value): - return isodate.parse_date(value) + try: + return isodate.parse_date(value) + except isodate.ISO8601Error: + # Recent versions of isodate don't support timezone in date's. This + # is not really ISO8601 compliant anway, but we should try to handle + # it. This is a hack to support this. + if "+" in value: + value = value.split("+")[0] + return isodate.parse_date(value) + if "Z" in value: + value = value.split("Z")[0] + return isodate.parse_date(value) + raise class gYearMonth(BuiltinType):