python3-commons 0.18.2__py3-none-any.whl → 0.18.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -172,13 +172,32 @@ class AsyncTransport(Transport):
172
172
  if not url:
173
173
  return b''
174
174
 
175
+ async def _fetch() -> bytes:
176
+ connector = TCPConnector(ssl=self._config.verify_ssl)
177
+
178
+ async with ClientSession(
179
+ connector=connector,
180
+ timeout=ClientTimeout(total=self._config.timeout),
181
+ headers={'User-Agent': f'Zeep/{get_version()} (www.python-zeep.org)'},
182
+ ) as session, session.get(url, proxy=self._config.proxy) as resp:
183
+ content = await resp.read()
184
+
185
+ if resp.status >= 400:
186
+ raise TransportError(
187
+ status_code=resp.status,
188
+ message=content.decode(errors='ignore'),
189
+ )
190
+
191
+ return content
192
+
175
193
  try:
176
194
  loop = asyncio.get_event_loop()
177
195
 
178
- return loop.run_until_complete(self._load_remote_data(url))
196
+ return loop.run_until_complete(_fetch())
179
197
  except RuntimeError:
180
198
  with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool:
181
- future = pool.submit(asyncio.run, self._load_remote_data(url))
199
+ future = pool.submit(asyncio.run, _fetch())
200
+
182
201
  return future.result()
183
202
 
184
203
  async def post(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-commons
3
- Version: 0.18.2
3
+ Version: 0.18.4
4
4
  Summary: Re-usable Python3 code
5
5
  Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
6
6
  License-Expression: GPL-3.0
@@ -11,7 +11,7 @@ python3_commons/generators.py,sha256=P6sKdCFhHT79-DZgzPU-qmwZvHg3wU8a75UFIwrycOY
11
11
  python3_commons/helpers.py,sha256=2U0XyiBhylPrPIdPkZ16jrJRDZBE-yKv9GjRIY4C-EA,4541
12
12
  python3_commons/object_storage.py,sha256=JB39Wb6rluAHa9oprsmB8d9UlY3sehsjX-aFmY_A-us,7219
13
13
  python3_commons/permissions.py,sha256=gaMKSWg0MgPQTdP1voll4ItXcblXku9BlD0Lq3Xv64U,1724
14
- python3_commons/soap_client.py,sha256=dZZWkg2RxFWr5yHfzcDK7SCy21FMfxctuDCoYiRBJII,8296
14
+ python3_commons/soap_client.py,sha256=GDI2g8L0UG8j2iWNmNxzAzInpOZRnbFr-0o6B5hQ7-E,8965
15
15
  python3_commons/db/__init__.py,sha256=i60JvWiUY8kz8nEaVjc5MA1IN_P5g3tK7jX8KgcUd0Y,3105
16
16
  python3_commons/db/helpers.py,sha256=xRpWs4aVkBge6HCLjb6OLSnWc1nlV6rKGyaVhZ_x12w,2001
17
17
  python3_commons/db/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -27,9 +27,9 @@ python3_commons/serializers/common.py,sha256=VkA7C6wODvHk0QBXVX_x2JieDstihx3U__U
27
27
  python3_commons/serializers/json.py,sha256=UPkC3ps13x2C_NxwVV-K7Ewp4VjkVHSSUkJVw5k7Wiw,712
28
28
  python3_commons/serializers/msgpack.py,sha256=zESFBX34GsZ8rDu6Zk5V6CLT6P0mPilU0r04Ka6TblI,1474
29
29
  python3_commons/serializers/msgspec.py,sha256=upy5CBmK66-8hYnK5bAM_sZvZY5CAqZmzCw9GIF346I,2988
30
- python3_commons-0.18.2.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
- python3_commons-0.18.2.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
- python3_commons-0.18.2.dist-info/METADATA,sha256=kIEA0rAgEB2EWJF1BCMXFPhRmxKK4oVasgPbNyZQAoo,2160
33
- python3_commons-0.18.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
- python3_commons-0.18.2.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
- python3_commons-0.18.2.dist-info/RECORD,,
30
+ python3_commons-0.18.4.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
+ python3_commons-0.18.4.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
+ python3_commons-0.18.4.dist-info/METADATA,sha256=Z4Iq1yO7MxoiGNtWFrc2XbRvU9VT9KocuWk8zv24TnA,2160
33
+ python3_commons-0.18.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
+ python3_commons-0.18.4.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
+ python3_commons-0.18.4.dist-info/RECORD,,