Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# --------------------------------------------------------------------------
from typing import Any, ContextManager, Iterator, Optional, Union

import httpx
import httpx # pylint: disable=networking-import-outside-azure-core-transport
from azure.core.configuration import ConnectionConfiguration
from azure.core.exceptions import DecodeError, ServiceRequestError, ServiceResponseError
from azure.core.pipeline import Pipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# --------------------------------------------------------------------------
from typing import Any, AsyncIterator, ContextManager, Optional, Union

import httpx
import httpx # pylint: disable=networking-import-outside-azure-core-transport
from azure.core.configuration import ConnectionConfiguration
from azure.core.exceptions import DecodeError, ServiceRequestError, ServiceResponseError
from azure.core.pipeline import Pipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ async def __aexit__(
return None


class AsyncHttpClientTransportResponse(_HttpClientTransportResponse, AsyncHttpResponse):
class AsyncHttpClientTransportResponse(
_HttpClientTransportResponse, AsyncHttpResponse
): # pylint: disable=abstract-method
"""Create a HTTPResponse from an http.client response.

Body will NOT be read by the constructor. Call "body()" to load the body in memory if necessary.
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/azure-core/azure/core/rest/_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from itertools import groupby
from typing import Iterator, cast

import aiohttp
import aiohttp # pylint: disable=networking-import-outside-azure-core-transport
from multidict import CIMultiDict

from ._http_response_impl_async import (
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/corehttp/corehttp/rest/_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ async def __anext__(self):
except aiohttp.client_exceptions.ClientPayloadError as err:
# This is the case that server closes connection before we finish the reading. aiohttp library
# raises ClientPayloadError.
_LOGGER.warning("Incomplete download: %s", err)
_LOGGER.warning("Incomplete download.")
internal_response.close()
raise IncompleteReadError(err, error=err) from err
except aiohttp.client_exceptions.ClientResponseError as err:
Expand All @@ -309,7 +309,7 @@ async def __anext__(self):
raise ServiceResponseError(err, error=err) from err
except aiohttp.client_exceptions.ClientError as err:
raise ServiceRequestError(err, error=err) from err
except Exception as err:
_LOGGER.warning("Unable to stream download: %s", err)
except Exception:
_LOGGER.warning("Unable to stream download.")
internal_response.close()
raise
16 changes: 8 additions & 8 deletions sdk/core/corehttp/corehttp/rest/_httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def __next__(self):
except httpx.RemoteProtocolError as ex:
msg = ex.__str__()
if "complete message" in msg:
_LOGGER.warning("Incomplete download: %s", ex)
_LOGGER.warning("Incomplete download.")
internal_response.close()
raise IncompleteReadError(ex, error=ex) from ex
_LOGGER.warning("Unable to stream download: %s", ex)
_LOGGER.warning("Unable to stream download.")
internal_response.close()
raise HttpResponseError(ex, error=ex) from ex
except httpx.DecodingError as ex:
Expand All @@ -108,8 +108,8 @@ def __next__(self):
raise DecodeError("Failed to decode.", error=ex) from ex
except httpx.RequestError as err:
raise ServiceRequestError(err, error=err) from err
except Exception as err:
_LOGGER.warning("Unable to stream download: %s", err)
except Exception:
_LOGGER.warning("Unable to stream download.")
internal_response.close()
raise

Expand Down Expand Up @@ -186,10 +186,10 @@ async def __anext__(self):
except httpx.RemoteProtocolError as ex:
msg = ex.__str__()
if "complete message" in msg:
_LOGGER.warning("Incomplete download: %s", ex)
_LOGGER.warning("Incomplete download.")
await internal_response.aclose()
raise IncompleteReadError(ex, error=ex) from ex
_LOGGER.warning("Unable to stream download: %s", ex)
_LOGGER.warning("Unable to stream download.")
await internal_response.aclose()
raise HttpResponseError(ex, error=ex) from ex
except httpx.DecodingError as ex:
Expand All @@ -198,7 +198,7 @@ async def __anext__(self):
raise DecodeError("Failed to decode.", error=ex) from ex
except httpx.RequestError as err:
raise ServiceRequestError(err, error=err) from err
except Exception as err:
_LOGGER.warning("Unable to stream download: %s", err)
except Exception:
_LOGGER.warning("Unable to stream download.")
await internal_response.aclose()
raise
6 changes: 3 additions & 3 deletions sdk/core/corehttp/corehttp/rest/_requests_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ def __next__(self):
except requests.exceptions.ChunkedEncodingError as err:
msg = err.__str__()
if "IncompleteRead" in msg:
_LOGGER.warning("Incomplete download: %s", err)
_LOGGER.warning("Incomplete download.")
internal_response.close()
raise IncompleteReadError(err, error=err) from err
_LOGGER.warning("Unable to stream download: %s", err)
_LOGGER.warning("Unable to stream download.")
internal_response.close()
raise HttpResponseError(err, error=err) from err
except Exception as err:
_LOGGER.warning("Unable to stream download: %s", err)
_LOGGER.warning("Unable to stream download.")
internal_response.close()
raise

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def on_request(self, request: PipelineRequest[HttpRequest]) -> None:
token = tracer._suppress_auto_http_instrumentation() # pylint: disable=protected-access
request.context[self._SUPPRESSION_TOKEN] = token
except Exception as err: # pylint: disable=broad-except
_LOGGER.warning("Unable to start HTTP span: %s", err)
_LOGGER.warning("Unable to start HTTP span: %s", err) # pylint: disable=do-not-log-exceptions-if-not-debug

def on_response(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ def send(
except requests.exceptions.ChunkedEncodingError as err:
msg = err.__str__()
if "IncompleteRead" in msg:
_LOGGER.warning("Incomplete download: %s", err)
_LOGGER.warning("Incomplete download.")
error = IncompleteReadError(err, error=err)
else:
_LOGGER.warning("Unable to stream download: %s", err)
_LOGGER.warning("Unable to stream download.")
error = HttpResponseError(err, error=err)
except requests.RequestException as err:
error = ServiceRequestError(err, error=err)
Expand Down
Loading