|
1 | | -from abc import ABC, abstractmethod |
2 | 1 | import asyncio |
| 2 | +import gzip |
3 | 3 | import io |
4 | 4 | import json |
5 | 5 | import os |
6 | | -import gzip |
7 | 6 | import socket |
8 | 7 | import ssl |
9 | 8 | import time |
10 | 9 | import warnings |
11 | | -from datetime import datetime, timedelta, timezone |
| 10 | +from abc import ABC, abstractmethod |
12 | 11 | from collections import defaultdict |
| 12 | +from datetime import datetime, timedelta, timezone |
13 | 13 | from urllib.request import getproxies |
14 | 14 |
|
15 | 15 | try: |
|
36 | 36 | except ImportError: |
37 | 37 | ASYNC_TRANSPORT_AVAILABLE = False |
38 | 38 |
|
39 | | -import urllib3 |
| 39 | +from typing import TYPE_CHECKING, Dict, List, cast |
| 40 | + |
40 | 41 | import certifi |
| 42 | +import urllib3 |
41 | 43 |
|
42 | 44 | import sentry_sdk |
43 | 45 | from sentry_sdk.consts import EndpointType |
| 46 | +from sentry_sdk.envelope import Envelope, Item, PayloadRef |
44 | 47 | from sentry_sdk.utils import ( |
45 | 48 | Dsn, |
46 | | - logger, |
47 | 49 | capture_internal_exceptions, |
| 50 | + logger, |
48 | 51 | mark_sentry_task_internal, |
49 | 52 | ) |
50 | | -from sentry_sdk.worker import BackgroundWorker, Worker, AsyncWorker |
51 | | -from sentry_sdk.envelope import Envelope, Item, PayloadRef |
52 | | - |
53 | | -from typing import TYPE_CHECKING, cast, List, Dict |
| 53 | +from sentry_sdk.worker import AsyncWorker, BackgroundWorker, Worker |
54 | 54 |
|
55 | 55 | if TYPE_CHECKING: |
56 | | - from typing import Any |
57 | | - from typing import Callable |
58 | | - from typing import DefaultDict |
59 | | - from typing import Iterable |
60 | | - from typing import Mapping |
61 | | - from typing import Optional |
62 | | - from typing import Self |
63 | | - from typing import Tuple |
64 | | - from typing import Type |
65 | | - from typing import Union |
66 | | - |
67 | | - from urllib3.poolmanager import PoolManager |
68 | | - from urllib3.poolmanager import ProxyManager |
| 56 | + from typing import ( |
| 57 | + Any, |
| 58 | + Callable, |
| 59 | + DefaultDict, |
| 60 | + Iterable, |
| 61 | + Mapping, |
| 62 | + Optional, |
| 63 | + Self, |
| 64 | + Tuple, |
| 65 | + Type, |
| 66 | + Union, |
| 67 | + ) |
| 68 | + |
| 69 | + from urllib3.poolmanager import PoolManager, ProxyManager |
69 | 70 |
|
70 | 71 | from sentry_sdk._types import Event, EventDataCategory |
71 | 72 |
|
@@ -1093,7 +1094,9 @@ def __init__(self, transport: "Transport") -> None: |
1093 | 1094 | def capture_envelope(self, envelope: "Envelope") -> None: |
1094 | 1095 | try: |
1095 | 1096 | logger.debug("--- Sentry Envelope ---") |
1096 | | - logger.debug("Headers: %s", json.dumps(envelope.headers, default=str)) |
| 1097 | + logger.debug( |
| 1098 | + "Headers: %s", json.dumps(envelope.headers, indent=2, default=str) |
| 1099 | + ) |
1097 | 1100 | for item in envelope.items: |
1098 | 1101 | logger.debug(" Item type: %s", item.type) |
1099 | 1102 | logger.debug( |
|
0 commit comments