Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-zeep for openSUSE:Factory 
checked in at 2022-03-13 22:03:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zeep (Old)
 and      /work/SRC/openSUSE:Factory/.python-zeep.new.25692 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-zeep"

Sun Mar 13 22:03:17 2022 rev:5 rq:961491 version:4.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-zeep/python-zeep.changes  2021-07-12 
01:25:09.077178403 +0200
+++ /work/SRC/openSUSE:Factory/.python-zeep.new.25692/python-zeep.changes       
2022-03-13 22:03:18.312511934 +0100
@@ -1,0 +2,13 @@
+Sun Mar 13 07:31:39 UTC 2022 - Wolfgang Rosenauer <w...@rosenauer.org>
+
+- Update to 4.1.0
+  * Remove last dependency on six
+  * Use platformdirs instead of the appsdirs dependency
+  * Pass digest method when signing timestamp node
+  * Fix settings context manager when an exception is raised
+  * Don???t render decimals using scientific notation
+  * Remove dependency on defusedxml
+  * Improve handling of str values for Duration
+- added httpx-test.patch to use text instead of data
+
+-------------------------------------------------------------------

Old:
----
  zeep-4.0.0.tar.gz

New:
----
  httpx-test.patch
  zeep-4.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-zeep.spec ++++++
--- /var/tmp/diff_new_pack.BNRdxe/_old  2022-03-13 22:03:18.832512190 +0100
+++ /var/tmp/diff_new_pack.BNRdxe/_new  2022-03-13 22:03:18.836512192 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-zeep
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,22 +19,22 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python36 1
 Name:           python-zeep
-Version:        4.0.0
+Version:        4.1.0
 Release:        0
 Summary:        A Python SOAP client based on lxml/requests
 License:        MIT
 Group:          Development/Languages/Python
 URL:            http://docs.python-zeep.org
 Source:         
https://files.pythonhosted.org/packages/source/z/zeep/zeep-%{version}.tar.gz
+Patch1:         httpx-test.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-Requires:       python-appdirs >= 1.4.0
 Requires:       python-attrs >= 17.2.0
 Requires:       python-cached-property >= 1.3.0
-Requires:       python-defusedxml >= 0.4.1
 Requires:       python-isodate >= 0.5.4
-Requires:       python-lxml >= 3.1.0
+Requires:       python-lxml >= 4.6.0
+Requires:       python-platformdirs >= 1.4.0
 Requires:       python-pytz
 Requires:       python-requests >= 2.7.0
 Requires:       python-requests-file >= 1.5.1
@@ -42,15 +42,14 @@
 Requires:       python-xmlsec >= 0.6.1
 BuildArch:      noarch
 # SECTION test requirements
-BuildRequires:  %{python_module appdirs >= 1.4.0}
+BuildRequires:  %{python_module platformdirs >= 1.4.0}
 BuildRequires:  %{python_module aiohttp >= 1.0}
 BuildRequires:  %{python_module aioresponses >= 0.4.1}
 BuildRequires:  %{python_module attrs >= 17.2.0}
 BuildRequires:  %{python_module cached-property >= 1.3.0}
-BuildRequires:  %{python_module defusedxml >= 0.4.1}
 BuildRequires:  %{python_module freezegun >= 0.3.15}
 BuildRequires:  %{python_module isodate >= 0.5.4}
-BuildRequires:  %{python_module lxml >= 3.1.0}
+BuildRequires:  %{python_module lxml >= 4.6.0}
 BuildRequires:  %{python_module mock >= 2.0.0}
 BuildRequires:  %{python_module pretend >= 1.0.9}
 BuildRequires:  %{python_module pytest >= 6.0.1}

++++++ httpx-test.patch ++++++
diff --git a/tests/test_async_transport.py b/tests/test_async_transport.py
index 940b48a..7cce440 100644
--- a/tests/test_async_transport.py
+++ b/tests/test_async_transport.py
@@ -21,7 +21,7 @@ def test_load(httpx_mock):
     cache = stub(get=lambda url: None, add=lambda url, content: None)
     transport = AsyncTransport(cache=cache)
 
-    httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml";, 
data="x")
+    httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml";, 
text="x")
     result = transport.load("http://tests.python-zeep.org/test.xml";)
     assert result == b"x"
 
@@ -32,7 +32,7 @@ def test_load_cache(httpx_mock):
     cache = InMemoryCache()
     transport = AsyncTransport(cache=cache)
 
-    httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml";, 
data="x")
+    httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml";, 
text="x")
     result = transport.load("http://tests.python-zeep.org/test.xml";)
     assert result == b"x"
 
@@ -47,7 +47,7 @@ async def test_post(httpx_mock: HTTPXMock):
 
     envelope = etree.Element("Envelope")
 
-    httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml";, 
data="x")
+    httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml";, 
text="x")
     result = await transport.post_xml(
         "http://tests.python-zeep.org/test.xml";, envelope=envelope, headers={}
     )
@@ -69,7 +69,7 @@ async def test_http_error(httpx_mock: HTTPXMock):
     transport = AsyncTransport()
 
     httpx_mock.add_response(
-        url="http://tests.python-zeep.org/test.xml";, data="x", status_code=500
+        url="http://tests.python-zeep.org/test.xml";, text="x", status_code=500
     )
     with pytest.raises(exceptions.TransportError) as exc:
         transport.load("http://tests.python-zeep.org/test.xml";)

++++++ zeep-4.0.0.tar.gz -> zeep-4.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/CHANGES new/zeep-4.1.0/CHANGES
--- old/zeep-4.0.0/CHANGES      2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/CHANGES      2021-08-15 20:52:32.000000000 +0200
@@ -1,3 +1,14 @@
+4.1.0 (2021-08-15)
+------------------
+ - Remove last dependency on `six` (#1250)
+ - Use `platformdirs` instead of the `appsdirs` dependency (#1244)
+ - Pass digest method when signing timestamp node(#1201)
+ - Fix settings context manager when an exception is raised (#1193)
+ - Don't render decimals using scientific notation (#1191)
+ - Remove dependency on `defusedxml` (deprecated) (#1179)
+ - Improve handling of str values for Duration (#1165)
+
+
 4.0.0 (2020-10-12)
 ------------------
  - Drop support for Python 2.7, 3.3, 3.4 and 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/CONTRIBUTORS.rst 
new/zeep-4.1.0/CONTRIBUTORS.rst
--- old/zeep-4.0.0/CONTRIBUTORS.rst     2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/CONTRIBUTORS.rst     2021-08-15 20:52:32.000000000 +0200
@@ -50,5 +50,5 @@
 * Raymond Piller
 * Zoltan Benedek
 * ??yvind Heddeland Instefjord
-
+* Pol Sanlorenzo
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/LICENSE new/zeep-4.1.0/LICENSE
--- old/zeep-4.0.0/LICENSE      2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/LICENSE      2021-08-15 20:52:32.000000000 +0200
@@ -24,9 +24,9 @@
 --
 
 Parts of the XSD handling are heavily inspired by soapfish, see:
-https://github.com/FlightDataServices/soapfish
+https://github.com/soapteam/soapfish
 
-Copyright (c) 2011-2014, soapfish contributors
+Copyright (c) 2011-2021, Soapfish Contributors
 All rights reserved.
 For the exact contribution history, see the git revision log.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/MANIFEST.in new/zeep-4.1.0/MANIFEST.in
--- old/zeep-4.0.0/MANIFEST.in  2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/MANIFEST.in  2021-08-15 20:52:32.000000000 +0200
@@ -7,6 +7,7 @@
 include CONTRIBUTORS.rst
 include LICENSE
 include README.rst
+include pyproject.toml
 include setup.cfg
 include setup.py
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/PKG-INFO new/zeep-4.1.0/PKG-INFO
--- old/zeep-4.0.0/PKG-INFO     2020-10-12 09:38:28.917696000 +0200
+++ new/zeep-4.1.0/PKG-INFO     2021-08-15 20:52:37.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: zeep
-Version: 4.0.0
+Version: 4.1.0
 Summary: A modern/fast Python SOAP client based on lxml / requests
 Home-page: http://docs.python-zeep.org
 Author: Michael van Tellingen
@@ -37,6 +37,7 @@
         
         Note that the latest version to support Python 2.7, 3.3, 3.4 and 3.5 
is Zeep 3.4, install via `pip install zeep==3.4.0`
         
+        Zeep uses the lxml library for parsing xml. See 
https://lxml.de/installation.html for the installation requirements.
         
         Usage
         -----
@@ -76,7 +77,7 @@
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Requires-Python: >=3.6
-Provides-Extra: xmlsec
-Provides-Extra: test
 Provides-Extra: docs
+Provides-Extra: test
 Provides-Extra: async
+Provides-Extra: xmlsec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/README.rst new/zeep-4.1.0/README.rst
--- old/zeep-4.0.0/README.rst   2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/README.rst   2021-08-15 20:52:32.000000000 +0200
@@ -46,6 +46,7 @@
 
 Note that the latest version to support Python 2.7, 3.3, 3.4 and 3.5 is Zeep 
3.4, install via `pip install zeep==3.4.0`
 
+Zeep uses the lxml library for parsing xml. See 
https://lxml.de/installation.html for the installation requirements.
 
 Usage
 -----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/examples/async_client.py 
new/zeep-4.1.0/examples/async_client.py
--- old/zeep-4.0.0/examples/async_client.py     2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/examples/async_client.py     2021-08-15 20:52:32.000000000 
+0200
@@ -11,11 +11,6 @@
     print("async example")
     print("=============")
 
-    result = []
-
-    def handle_future(future):
-        result.extend(future.result())
-
     loop = asyncio.get_event_loop()
 
     client = zeep.AsyncClient("http://localhost:8000/?wsdl";)
@@ -26,14 +21,11 @@
     ]
     future = asyncio.gather(*tasks, return_exceptions=True)
 
-    result = []
-    future.add_done_callback(handle_future)
-
     st = time.time()
     loop.run_until_complete(future)
     loop.run_until_complete(client.transport.aclose())
     print("time: %.2f" % (time.time() - st))
-    print("result: %s", result)
+    print("result:", future.result())
     print("")
     return future
 
@@ -50,7 +42,7 @@
         client.service.slow_request("request-2"),  # takes 1 sec
     ]
     print("Time: %.2f" % (time.time() - st))
-    print("result: %s", result)
+    print("result:", result)
     print("\n")
 
     return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/pyproject.toml 
new/zeep-4.1.0/pyproject.toml
--- old/zeep-4.0.0/pyproject.toml       1970-01-01 01:00:00.000000000 +0100
+++ new/zeep-4.1.0/pyproject.toml       2021-08-15 20:52:32.000000000 +0200
@@ -0,0 +1,32 @@
+[build-system]
+requires = ["setuptools>=40.6.0", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[tool.coverage.run]
+branch = true
+source = ["zeep"]
+
+[tool.coverage.paths]
+source = ["src", "*/site-packages/"]
+
+[tool.coverage.report]
+show_missing = true
+
+[tool.isort]
+line_length = 88
+multi_line_output = 3
+include_trailing_comma = true
+balanced_wrapping = true
+default_section = "THIRDPARTY"
+known_first_party = ["zeep", "tests"]
+use_parentheses = true
+
+[tool.pytest.ini_options]
+minversion = "6.0"
+testpaths = [
+    "tests",
+]
+markers = [
+    # mark a test to allow socket usage
+    "requests"
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/setup.py new/zeep-4.1.0/setup.py
--- old/zeep-4.0.0/setup.py     2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/setup.py     2021-08-15 20:52:32.000000000 +0200
@@ -3,12 +3,11 @@
 from setuptools import setup
 
 install_requires = [
-    "appdirs>=1.4.0",
     "attrs>=17.2.0",
     "cached-property>=1.3.0",
-    "defusedxml>=0.4.1",
     "isodate>=0.5.4",
-    "lxml>=3.1.0",
+    "lxml>=4.6.0",
+    "platformdirs>=1.4.0",
     "requests>=2.7.0",
     "requests-toolbelt>=0.7.1",
     "requests-file>=1.5.1",
@@ -51,7 +50,7 @@
 
 setup(
     name="zeep",
-    version="4.0.0",
+    version="4.1.0",
     description="A modern/fast Python SOAP client based on lxml / requests",
     long_description=long_description,
     author="Michael van Tellingen",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/__init__.py 
new/zeep-4.1.0/src/zeep/__init__.py
--- old/zeep-4.0.0/src/zeep/__init__.py 2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/__init__.py 2021-08-15 20:52:32.000000000 +0200
@@ -4,4 +4,4 @@
 from zeep.transports import Transport  # noqa
 from zeep.xsd.valueobjects import AnyObject  # noqa
 
-__version__ = "4.0.0"
+__version__ = "4.1.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/cache.py 
new/zeep-4.1.0/src/zeep/cache.py
--- old/zeep-4.0.0/src/zeep/cache.py    2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/cache.py    2021-08-15 20:52:32.000000000 +0200
@@ -7,7 +7,7 @@
 import typing
 from contextlib import contextmanager
 
-import appdirs
+import platformdirs
 import pytz
 
 # The sqlite3 is not available on Google App Engine so we handle the
@@ -176,7 +176,7 @@
 
 
 def _get_default_cache_path():
-    path = appdirs.user_cache_dir("zeep", False)
+    path = platformdirs.user_cache_dir("zeep", False)
     try:
         os.makedirs(path)
     except OSError as exc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/client.py 
new/zeep-4.1.0/src/zeep/client.py
--- old/zeep-4.0.0/src/zeep/client.py   2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/client.py   2021-08-15 20:52:32.000000000 +0200
@@ -234,8 +234,11 @@
         port = self._get_port(service, port_name)
         return AsyncServiceProxy(self, port.binding, **port.binding_options)
 
+    async def __aenter__(self):
+        return self
+
     async def __aexit__(self, exc_type=None, exc_value=None, traceback=None) 
-> None:
-        await self.transport.close()
+        await self.transport.aclose()
 
 
 class CachingClient(Client):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/exceptions.py 
new/zeep-4.1.0/src/zeep/exceptions.py
--- old/zeep-4.0.0/src/zeep/exceptions.py       2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/src/zeep/exceptions.py       2021-08-15 20:52:32.000000000 
+0200
@@ -91,3 +91,26 @@
 
 class IncompleteOperation(Error):
     pass
+
+
+class DTDForbidden(Error):
+    def __init__(self, name, sysid, pubid):
+        super(DTDForbidden, self).__init__()
+        self.name = name
+        self.sysid = sysid
+        self.pubid = pubid
+
+    def __str__(self):
+        tpl = "DTDForbidden(name='{}', system_id={!r}, public_id={!r})"
+        return tpl.format(self.name, self.sysid, self.pubid)
+
+
+class EntitiesForbidden(Error):
+    def __init__(self, name, content):
+        super(EntitiesForbidden, self).__init__()
+        self.name = name
+        self.content = content
+
+    def __str__(self):
+        tpl = "EntitiesForbidden(name='{}', content={!r})"
+        return tpl.format(self.name, self.content)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/loader.py 
new/zeep-4.1.0/src/zeep/loader.py
--- old/zeep-4.0.0/src/zeep/loader.py   2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/loader.py   2021-08-15 20:52:32.000000000 +0200
@@ -2,14 +2,14 @@
 import typing
 from urllib.parse import urljoin, urlparse, urlunparse
 
-from defusedxml.lxml import fromstring
 from lxml import etree
+from lxml.etree import Resolver, XMLParser, XMLSyntaxError, fromstring
 
-from zeep.exceptions import XMLSyntaxError
+from zeep.exceptions import DTDForbidden, EntitiesForbidden, XMLSyntaxError
 from zeep.settings import Settings
 
 
-class ImportResolver(etree.Resolver):
+class ImportResolver(Resolver):
     """Custom lxml resolve to use the transport object"""
 
     def __init__(self, transport):
@@ -39,7 +39,7 @@
     """
     settings = settings or Settings()
     recover = not settings.strict
-    parser = etree.XMLParser(
+    parser = XMLParser(
         remove_comments=True,
         resolve_entities=False,
         recover=recover,
@@ -47,13 +47,21 @@
     )
     parser.resolvers.add(ImportResolver(transport))
     try:
-        return fromstring(
-            content,
-            parser=parser,
-            base_url=base_url,
-            forbid_dtd=settings.forbid_dtd,
-            forbid_entities=settings.forbid_entities,
-        )
+        elementtree = fromstring(content, parser=parser, base_url=base_url)
+        docinfo = elementtree.getroottree().docinfo
+        if docinfo.doctype:
+            if settings.forbid_dtd:
+                raise DTDForbidden(
+                    docinfo.doctype, docinfo.system_url, docinfo.public_id
+                )
+        if settings.forbid_entities:
+            for dtd in docinfo.internalDTD, docinfo.externalDTD:
+                if dtd is None:
+                    continue
+                for entity in dtd.iterentities():
+                    raise EntitiesForbidden(entity.name, entity.content)
+
+        return elementtree
     except etree.XMLSyntaxError as exc:
         raise XMLSyntaxError(
             "Invalid XML content received (%s)" % exc.msg, content=content
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/proxy.py 
new/zeep-4.1.0/src/zeep/proxy.py
--- old/zeep-4.0.0/src/zeep/proxy.py    2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/proxy.py    2021-08-15 20:52:32.000000000 +0200
@@ -99,11 +99,11 @@
             raise AttributeError("Service has no operation %r" % key)
 
     def __iter__(self):
-        """ Return iterator over the services and their callables. """
+        """Return iterator over the services and their callables."""
         return iter(self._operations.items())
 
     def __dir__(self):
-        """ Return the names of the operations. """
+        """Return the names of the operations."""
         return list(itertools.chain(dir(super()), self._operations))
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/settings.py 
new/zeep-4.1.0/src/zeep/settings.py
--- old/zeep-4.0.0/src/zeep/settings.py 2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/settings.py 2021-08-15 20:52:32.000000000 +0200
@@ -65,14 +65,15 @@
             current[key] = getattr(self, key)
             setattr(self._tls, key, value)
 
-        yield
-
-        for key, value in current.items():
-            default = getattr(self, key)
-            if value == default:
-                delattr(self._tls, key)
-            else:
-                setattr(self._tls, key, value)
+        try:
+            yield
+        finally:
+            for key, value in current.items():
+                default = getattr(self, key)
+                if value == default:
+                    delattr(self._tls, key)
+                else:
+                    setattr(self._tls, key, value)
 
     def __getattribute__(self, key):
         if key != "_tls" and hasattr(self._tls, key):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/wsdl/bindings/http.py 
new/zeep-4.1.0/src/zeep/wsdl/bindings/http.py
--- old/zeep-4.0.0/src/zeep/wsdl/bindings/http.py       2020-10-12 
09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/wsdl/bindings/http.py       2021-08-15 
20:52:32.000000000 +0200
@@ -7,6 +7,7 @@
 from zeep.utils import qname_attr
 from zeep.wsdl import messages
 from zeep.wsdl.definitions import Binding, Operation
+from zeep.wsdl.utils import url_http_to_https
 
 logger = logging.getLogger(__name__)
 
@@ -28,9 +29,10 @@
 
         # Force the usage of HTTPS when the force_https boolean is true
         location = address_node.get("location")
-        if force_https and location and location.startswith("http://";):
-            logger.warning("Forcing http:address location to HTTPS")
-            location = "https://"; + location[8:]
+        if force_https and location:
+            location = url_http_to_https(location)
+            if location != address_node.get("location"):
+                logger.warning("Forcing http:address location to HTTPS")
 
         return {"address": location}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/wsdl/bindings/soap.py 
new/zeep-4.1.0/src/zeep/wsdl/bindings/soap.py
--- old/zeep-4.0.0/src/zeep/wsdl/bindings/soap.py       2020-10-12 
09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/wsdl/bindings/soap.py       2021-08-15 
20:52:32.000000000 +0200
@@ -322,7 +322,7 @@
             )
 
         def get_text(name):
-            child = fault_node.find(name)
+            child = fault_node.find(name, namespaces=fault_node.nsmap)
             if child is not None:
                 return child.text
 
@@ -330,7 +330,7 @@
             message=get_text("faultstring"),
             code=get_text("faultcode"),
             actor=get_text("faultactor"),
-            detail=fault_node.find("detail"),
+            detail=fault_node.find("detail", namespaces=fault_node.nsmap),
         )
 
     def _set_http_headers(self, serialized, operation):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/wsdl/messages/base.py 
new/zeep-4.1.0/src/zeep/wsdl/messages/base.py
--- old/zeep-4.0.0/src/zeep/wsdl/messages/base.py       2020-10-12 
09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/wsdl/messages/base.py       2021-08-15 
20:52:32.000000000 +0200
@@ -12,7 +12,7 @@
 
 
 class ConcreteMessage:
-    """Represents the wsdl:binding -> wsdl:operation -> input/ouput node"""
+    """Represents the wsdl:binding -> wsdl:operation -> input/output node"""
 
     if typing.TYPE_CHECKING:
         body = None  # type: typing.Optional[xsd.Element]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/wsdl/messages/mime.py 
new/zeep-4.1.0/src/zeep/wsdl/messages/mime.py
--- old/zeep-4.0.0/src/zeep/wsdl/messages/mime.py       2020-10-12 
09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/wsdl/messages/mime.py       2021-08-15 
20:52:32.000000000 +0200
@@ -5,8 +5,8 @@
 """
 from urllib.parse import urlencode
 
-from defusedxml.lxml import fromstring
 from lxml import etree
+from lxml.etree import fromstring
 
 from zeep import ns, xsd
 from zeep.helpers import serialize_object
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/wsse/signature.py 
new/zeep-4.1.0/src/zeep/wsse/signature.py
--- old/zeep-4.0.0/src/zeep/wsse/signature.py   2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/src/zeep/wsse/signature.py   2021-08-15 20:52:32.000000000 
+0200
@@ -244,7 +244,7 @@
     _sign_node(ctx, signature, envelope.find(QName(soap_env, "Body")), 
digest_method)
     timestamp = security.find(QName(ns.WSU, "Timestamp"))
     if timestamp != None:
-        _sign_node(ctx, signature, timestamp)
+        _sign_node(ctx, signature, timestamp, digest_method)
     ctx.sign(signature)
 
     # Place the X509 data inside a WSSE SecurityTokenReference within
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/wsse/username.py 
new/zeep-4.1.0/src/zeep/wsse/username.py
--- old/zeep-4.0.0/src/zeep/wsse/username.py    2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/src/zeep/wsse/username.py    2021-08-15 20:52:32.000000000 
+0200
@@ -2,8 +2,6 @@
 import hashlib
 import os
 
-import six
-
 from zeep import ns
 from zeep.wsse import utils
 
@@ -108,7 +106,7 @@
             nonce = os.urandom(16)
         timestamp = utils.get_timestamp(self.created, self.zulu_timestamp)
 
-        if isinstance(self.password, six.string_types):
+        if isinstance(self.password, str):
             password = self.password.encode("utf-8")
         else:
             password = self.password
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep/xsd/types/builtins.py 
new/zeep-4.1.0/src/zeep/xsd/types/builtins.py
--- old/zeep-4.0.0/src/zeep/xsd/types/builtins.py       2020-10-12 
09:38:21.000000000 +0200
+++ new/zeep-4.1.0/src/zeep/xsd/types/builtins.py       2021-08-15 
20:52:32.000000000 +0200
@@ -88,6 +88,8 @@
 
     @check_no_collection
     def xmlvalue(self, value):
+        if isinstance(value, _Decimal):
+            return "{:f}".format(value)
         return str(value)
 
     @treat_whitespace("collapse")
@@ -122,10 +124,12 @@
 
 class Duration(BuiltinType):
     _default_qname = xsd_ns("duration")
-    accepted_types = [isodate.duration.Duration, str]
+    accepted_types = [isodate.duration.Duration, datetime.timedelta, str]
 
     @check_no_collection
     def xmlvalue(self, value):
+        if isinstance(value, str):
+            value = isodate.parse_duration(value)
         return isodate.duration_isoformat(value)
 
     @treat_whitespace("collapse")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep.egg-info/PKG-INFO 
new/zeep-4.1.0/src/zeep.egg-info/PKG-INFO
--- old/zeep-4.0.0/src/zeep.egg-info/PKG-INFO   2020-10-12 09:38:28.000000000 
+0200
+++ new/zeep-4.1.0/src/zeep.egg-info/PKG-INFO   2021-08-15 20:52:37.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: zeep
-Version: 4.0.0
+Version: 4.1.0
 Summary: A modern/fast Python SOAP client based on lxml / requests
 Home-page: http://docs.python-zeep.org
 Author: Michael van Tellingen
@@ -37,6 +37,7 @@
         
         Note that the latest version to support Python 2.7, 3.3, 3.4 and 3.5 
is Zeep 3.4, install via `pip install zeep==3.4.0`
         
+        Zeep uses the lxml library for parsing xml. See 
https://lxml.de/installation.html for the installation requirements.
         
         Usage
         -----
@@ -76,7 +77,7 @@
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Requires-Python: >=3.6
-Provides-Extra: xmlsec
-Provides-Extra: test
 Provides-Extra: docs
+Provides-Extra: test
 Provides-Extra: async
+Provides-Extra: xmlsec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep.egg-info/SOURCES.txt 
new/zeep-4.1.0/src/zeep.egg-info/SOURCES.txt
--- old/zeep-4.0.0/src/zeep.egg-info/SOURCES.txt        2020-10-12 
09:38:28.000000000 +0200
+++ new/zeep-4.1.0/src/zeep.egg-info/SOURCES.txt        2021-08-15 
20:52:37.000000000 +0200
@@ -3,6 +3,7 @@
 LICENSE
 MANIFEST.in
 README.rst
+pyproject.toml
 setup.cfg
 setup.py
 examples/Makefile
@@ -84,6 +85,7 @@
 tests/cert_valid.pem
 tests/cert_valid_pw.pem
 tests/conftest.py
+tests/test_async_client.py
 tests/test_async_transport.py
 tests/test_cache.py
 tests/test_client.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/src/zeep.egg-info/requires.txt 
new/zeep-4.1.0/src/zeep.egg-info/requires.txt
--- old/zeep-4.0.0/src/zeep.egg-info/requires.txt       2020-10-12 
09:38:28.000000000 +0200
+++ new/zeep-4.1.0/src/zeep.egg-info/requires.txt       2021-08-15 
20:52:37.000000000 +0200
@@ -1,9 +1,8 @@
-appdirs>=1.4.0
 attrs>=17.2.0
 cached-property>=1.3.0
-defusedxml>=0.4.1
 isodate>=0.5.4
-lxml>=3.1.0
+lxml>=4.6.0
+platformdirs>=1.4.0
 requests>=2.7.0
 requests-toolbelt>=0.7.1
 requests-file>=1.5.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_async_client.py 
new/zeep-4.1.0/tests/test_async_client.py
--- old/zeep-4.0.0/tests/test_async_client.py   1970-01-01 01:00:00.000000000 
+0100
+++ new/zeep-4.1.0/tests/test_async_client.py   2021-08-15 20:52:32.000000000 
+0200
@@ -0,0 +1,10 @@
+import pytest
+
+from zeep import AsyncClient
+
+
+@pytest.mark.requests
+@pytest.mark.asyncio
+async def test_context_manager():
+    async with AsyncClient("tests/wsdl_files/soap.wsdl") as async_client:
+        assert async_client
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_client.py 
new/zeep-4.1.0/tests/test_client.py
--- old/zeep-4.0.0/tests/test_client.py 2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/tests/test_client.py 2021-08-15 20:52:32.000000000 +0200
@@ -91,6 +91,19 @@
         expected_url = "https://example.com/stockquote";
         assert binding_options["address"] == expected_url
 
+    with open("tests/wsdl_files/http.wsdl") as fh:
+        response = fh.read()
+
+    with requests_mock.mock() as m:
+        url = "https://tests.python-zeep.org/wsdl";
+        m.get(url, text=response, status_code=200)
+        client_obj = client.Client(url)
+        binding_options = client_obj.service._binding_options
+        assert binding_options["address"].startswith("https")
+
+        expected_url = "https://example.com/stockquote";
+        assert binding_options["address"] == expected_url
+
 
 @pytest.mark.requests
 def test_create_service():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_loader.py 
new/zeep-4.1.0/tests/test_loader.py
--- old/zeep-4.0.0/tests/test_loader.py 2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/tests/test_loader.py 2021-08-15 20:52:32.000000000 +0200
@@ -1,8 +1,8 @@
 import pytest
-from defusedxml import DTDForbidden, EntitiesForbidden
 from pytest import raises as assert_raises
 
 from tests.utils import DummyTransport
+from zeep.exceptions import DTDForbidden, EntitiesForbidden
 from zeep.loader import parse_xml
 from zeep.settings import Settings
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_settings.py 
new/zeep-4.1.0/tests/test_settings.py
--- old/zeep-4.0.0/tests/test_settings.py       2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/tests/test_settings.py       2021-08-15 20:52:32.000000000 
+0200
@@ -13,3 +13,17 @@
             assert settings.raw_response is True
     # Check that the original value returned
     assert settings.raw_response is False
+
+
+def test_settings_set_context_with_exception():
+    settings = Settings()
+
+    assert settings.raw_response is False
+    try:
+        with settings(raw_response=True):
+            assert settings.raw_response is True
+            raise RuntimeError
+    except RuntimeError:
+        pass
+    # Check that the original value returned
+    assert settings.raw_response is False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_wsdl.py 
new/zeep-4.1.0/tests/test_wsdl.py
--- old/zeep-4.0.0/tests/test_wsdl.py   2020-10-12 09:38:21.000000000 +0200
+++ new/zeep-4.1.0/tests/test_wsdl.py   2021-08-15 20:52:32.000000000 +0200
@@ -3,12 +3,12 @@
 
 import pytest
 import requests_mock
-from defusedxml import DTDForbidden, EntitiesForbidden
 from lxml import etree
 from pretend import stub
 
 from tests.utils import DummyTransport, assert_nodes_equal
 from zeep import Client, Settings, wsdl
+from zeep.exceptions import DTDForbidden, EntitiesForbidden
 from zeep.transports import Transport
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_wsdl_soap.py 
new/zeep-4.1.0/tests/test_wsdl_soap.py
--- old/zeep-4.0.0/tests/test_wsdl_soap.py      2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/tests/test_wsdl_soap.py      2021-08-15 20:52:32.000000000 
+0200
@@ -62,6 +62,39 @@
         assert exc.subcodes is None
         assert "detail-message" in etree.tostring(exc.detail).decode("utf-8")
 
+    responseWithNamespaceInFault = load_xml(
+        """
+        <soapenv:Envelope
+            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
+            xmlns:stoc="http://example.com/stockquote.xsd";>
+          <soapenv:Body>
+            <soapenv:Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/";>
+              <faultcode>fault-code-withNamespace</faultcode>
+              <faultstring>fault-string-withNamespace</faultstring>
+              <detail>
+                <e:myFaultDetails xmlns:e="http://myexample.org/faults";>
+                  <e:message>detail-message-withNamespace</e:message>
+                  <e:errorcode>detail-code-withNamespace</e:errorcode>
+                </e:myFaultDetails>
+              </detail>
+            </soapenv:Fault>
+          </soapenv:Body>
+        </soapenv:Envelope>
+    """
+    )
+
+    try:
+        binding.process_error(responseWithNamespaceInFault, None)
+        assert False
+    except Fault as exc:
+        assert exc.message == "fault-string-withNamespace"
+        assert exc.code == "fault-code-withNamespace"
+        assert exc.actor is None
+        assert exc.subcodes is None
+        assert "detail-message-withNamespace" in 
etree.tostring(exc.detail).decode(
+            "utf-8"
+        )
+
 
 def test_soap12_process_error():
     response = """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_wsse_signature.py 
new/zeep-4.1.0/tests/test_wsse_signature.py
--- old/zeep-4.0.0/tests/test_wsse_signature.py 2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/tests/test_wsse_signature.py 2021-08-15 20:52:32.000000000 
+0200
@@ -35,7 +35,16 @@
 
 
 @skip_if_no_xmlsec
-def test_sign_timestamp_if_present():
+@pytest.mark.parametrize("digest_method,expected_digest_href", 
DIGEST_METHODS_TESTDATA)
+@pytest.mark.parametrize(
+    "signature_method,expected_signature_href", SIGNATURE_METHODS_TESTDATA
+)
+def test_sign_timestamp_if_present(
+    digest_method,
+    signature_method,
+    expected_digest_href,
+    expected_signature_href,
+):
     envelope = load_xml(
         """
         <soap-env:Envelope
@@ -63,8 +72,23 @@
     """
     )
 
-    signature.sign_envelope(envelope, KEY_FILE, KEY_FILE)
+    signature.sign_envelope(
+        envelope,
+        KEY_FILE,
+        KEY_FILE,
+        None,
+        signature_method=getattr(xmlsec_installed.Transform, signature_method),
+        digest_method=getattr(xmlsec_installed.Transform, digest_method),
+    )
     signature.verify_envelope(envelope, KEY_FILE)
+    digests = envelope.xpath("//ds:DigestMethod", namespaces={"ds": ns.DS})
+    assert len(digests)
+    for digest in digests:
+        assert digest.get("Algorithm") == expected_digest_href
+    signatures = envelope.xpath("//ds:SignatureMethod", namespaces={"ds": 
ns.DS})
+    assert len(signatures)
+    for sig in signatures:
+        assert sig.get("Algorithm") == expected_signature_href
 
 
 @skip_if_no_xmlsec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zeep-4.0.0/tests/test_xsd_builtins.py 
new/zeep-4.1.0/tests/test_xsd_builtins.py
--- old/zeep-4.0.0/tests/test_xsd_builtins.py   2020-10-12 09:38:21.000000000 
+0200
+++ new/zeep-4.1.0/tests/test_xsd_builtins.py   2021-08-15 20:52:32.000000000 
+0200
@@ -83,6 +83,9 @@
         assert instance.xmlvalue(D("10.000002")) == "10.000002"
         assert instance.xmlvalue(D("10")) == "10"
         assert instance.xmlvalue(D("-10")) == "-10"
+        assert instance.xmlvalue(D("1.1E-3")) == "0.0011"
+        assert instance.xmlvalue(D("1.1E+3")) == "1100"
+        assert instance.xmlvalue(D("1.100000000000002E-3")) == 
"0.001100000000000002"
 
     def test_pythonvalue(self):
         instance = builtins.Decimal()
@@ -136,6 +139,10 @@
         instance = builtins.Duration()
         value = isodate.parse_duration("P0Y1347M0D")
         assert instance.xmlvalue(value) == "P1347M"
+        assert instance.xmlvalue("P0Y1347M0D") == "P1347M"
+        assert instance.xmlvalue(datetime.timedelta(days=1347)) == "P1347D"
+        with pytest.raises(ValueError):
+            instance.xmlvalue("P15T")
 
     def test_pythonvalue(self):
         instance = builtins.Duration()

Reply via email to