From d7ae024951d30b9409104d0bf294f8e1cf05064f Mon Sep 17 00:00:00 2001 From: Deivis Laya Date: Fri, 17 Mar 2023 17:47:37 +0000 Subject: [PATCH] [FIX] sentry: change with_locals to include_local_variables variable Currently, version 1.17.0 of sentry_sdk is causing the following error: SentryOption("with_locals", DEFAULT_OPTIONS["with_locals"], None), KeyError: 'with_locals'. Where the with_locals key is not found in the dictionary, generating an error, stopping the installation of the sentry module. In version 1.17.0 rename 'with_locals' to 'include_local_variables' https://github.com/getsentry/sentry-python/commit/79e33169aa629ec67cf9636b8440f64bf0a6d566 This commit adjust the get_sentry_options() method in https://github.com/Vauxoo/server-tools/blob/16.0/sentry/const.py file, set the new variable. --- requirements.txt | 2 +- sentry/__manifest__.py | 2 +- sentry/const.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 546b3d740..d1df8effa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ dataclasses mako odoorpc openupgradelib -sentry_sdk +sentry_sdk>=1.17.0 diff --git a/sentry/__manifest__.py b/sentry/__manifest__.py index 3f7b8c75e..0995d6d16 100644 --- a/sentry/__manifest__.py +++ b/sentry/__manifest__.py @@ -17,7 +17,7 @@ "installable": True, "external_dependencies": { "python": [ - "sentry_sdk", + "sentry_sdk>=1.17.0", ] }, "depends": [ diff --git a/sentry/const.py b/sentry/const.py index c3135a9df..3e1bce287 100644 --- a/sentry/const.py +++ b/sentry/const.py @@ -77,7 +77,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 ),