From a1969c2d2cc33221882a07f56b1ecfecc3ae531f Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Tue, 21 Jan 2025 19:50:58 -0500 Subject: [PATCH] [IMP] bump sentry_sdk version --- requirements.txt | 2 +- sentry/__manifest__.py | 2 +- sentry/const.py | 8 ++++++-- sentry/hooks.py | 2 +- sentry/logutils.py | 7 +++---- sentry/processor.py | 4 +--- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index 09418114542..09bb3426173 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ dataclasses mako odoorpc openupgradelib -sentry_sdk<=1.9.0 +sentry_sdk>=2.0.0 diff --git a/sentry/__manifest__.py b/sentry/__manifest__.py index b898e3f33d4..3cbd41ba3eb 100644 --- a/sentry/__manifest__.py +++ b/sentry/__manifest__.py @@ -17,7 +17,7 @@ "installable": True, "external_dependencies": { "python": [ - "sentry_sdk<=1.9.0", + "sentry_sdk>=2.0.0", ] }, "depends": [ diff --git a/sentry/const.py b/sentry/const.py index a3195d54f5f..7772c26a8f5 100644 --- a/sentry/const.py +++ b/sentry/const.py @@ -81,7 +81,9 @@ def get_sentry_options(): SentryOption("dsn", "", str.strip), SentryOption("transport", DEFAULT_OPTIONS["transport"], select_transport), SentryOption("logging_level", DEFAULT_LOG_LEVEL, get_sentry_logging), - SentryOption("with_locals", DEFAULT_OPTIONS["with_locals"], None), + SentryOption( + "include_local_variables", DEFAULT_OPTIONS["include_local_variables"], None + ), SentryOption( "max_breadcrumbs", DEFAULT_OPTIONS["max_breadcrumbs"], to_int_if_defined ), @@ -107,7 +109,9 @@ def get_sentry_options(): SentryOption("http_proxy", DEFAULT_OPTIONS["http_proxy"], None), SentryOption("https_proxy", DEFAULT_OPTIONS["https_proxy"], None), SentryOption("ignore_exceptions", DEFAULT_IGNORED_EXCEPTIONS, split_multiple), - SentryOption("request_bodies", DEFAULT_OPTIONS["request_bodies"], None), + SentryOption( + "max_request_body_size", DEFAULT_OPTIONS["max_request_body_size"], None + ), SentryOption("attach_stacktrace", DEFAULT_OPTIONS["attach_stacktrace"], None), SentryOption("ca_certs", DEFAULT_OPTIONS["ca_certs"], None), SentryOption("propagate_traces", DEFAULT_OPTIONS["propagate_traces"], None), diff --git a/sentry/hooks.py b/sentry/hooks.py index d3ddf250475..ee39501953b 100644 --- a/sentry/hooks.py +++ b/sentry/hooks.py @@ -143,7 +143,7 @@ def initialize_sentry(config): # Patch the wsgi server in case of further registration odoo.http.Application = SentryWsgiMiddleware(odoo.http.Application) - with sentry_sdk.push_scope() as scope: + with sentry_sdk.new_scope() as scope: scope.set_extra("debug", False) sentry_sdk.capture_message("Starting Odoo Server", "info") diff --git a/sentry/logutils.py b/sentry/logutils.py index 44e53972e47..b0b0958f3f1 100644 --- a/sentry/logutils.py +++ b/sentry/logutils.py @@ -4,7 +4,6 @@ import os.path import urllib.parse -from sentry_sdk._compat import text_type from werkzeug import datastructures from .generalutils import get_environ @@ -81,7 +80,7 @@ def fetch_git_sha(path, head=None): ) with open(head_path) as fp: - head = text_type(fp.read()).strip() + head = str(fp.read()).strip() if head.startswith("ref: "): head = head[5:] @@ -110,9 +109,9 @@ def fetch_git_sha(path, head=None): except ValueError: continue if ref == head: - return text_type(revision) + return str(revision) raise InvalidGitRepository(f"Unable to find ref to head {head} in repository") with open(revision_file) as fh: - return text_type(fh.read()).strip() + return str(fh.read()).strip() diff --git a/sentry/processor.py b/sentry/processor.py index 47b56ab030b..e8298f7b22f 100644 --- a/sentry/processor.py +++ b/sentry/processor.py @@ -6,8 +6,6 @@ import re -from sentry_sdk._compat import text_type - from .generalutils import string_types, varmap @@ -51,7 +49,7 @@ def sanitize(self, item, value): if isinstance(item, bytes): item = item.decode("utf-8", "replace") else: - item = text_type(item) + item = str(item) item = item.lower() for key in self.sanitize_keys: