Skip to content

Commit 11fa2a5

Browse files
[FIX] sentry: Fix KeyError 'with_locals' on DEFAULT_OPTIONS
See original migration for reference: getsentry/sentry-python@888c0e1
1 parent 2ffe4e9 commit 11fa2a5

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

sentry/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ configuration file:
103103
Other `client arguments
104104
<https://docs.sentry.io/platforms/python/configuration/>`_ can be
105105
configured by prepending the argument name with *sentry_* in your Odoo config
106-
file. Currently supported additional client arguments are: ``with_locals,
106+
file. Currently supported additional client arguments are: ``include_local_variables,
107107
max_breadcrumbs, release, environment, server_name, shutdown_timeout,
108108
in_app_include, in_app_exclude, default_integrations, dist, sample_rate,
109109
send_default_pii, http_proxy, https_proxy, request_bodies, debug,

sentry/const.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def get_sentry_options():
8181
SentryOption("dsn", "", str.strip),
8282
SentryOption("transport", DEFAULT_OPTIONS["transport"], select_transport),
8383
SentryOption("logging_level", DEFAULT_LOG_LEVEL, get_sentry_logging),
84-
SentryOption("with_locals", DEFAULT_OPTIONS["with_locals"], None),
84+
SentryOption(
85+
"include_local_variables", DEFAULT_OPTIONS["include_local_variables"], None
86+
),
8587
SentryOption(
8688
"max_breadcrumbs", DEFAULT_OPTIONS["max_breadcrumbs"], to_int_if_defined
8789
),

sentry/hooks.py

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ def initialize_sentry(config):
9797
"Its not neccesary send it, will use `HttpTranport` by default.",
9898
DeprecationWarning,
9999
)
100+
if config.get("sentry_with_locals"):
101+
warnings.warn(
102+
"`with_locals` has been deprecated. "
103+
"Use `include_local_variables` instead."
104+
)
100105
options = {}
101106
for option in const.get_sentry_options():
102107
value = config.get("sentry_%s" % option.key, option.default)

sentry/readme/CONFIGURE.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ configuration file:
4848
Other `client arguments
4949
<https://docs.sentry.io/platforms/python/configuration/>`_ can be
5050
configured by prepending the argument name with *sentry_* in your Odoo config
51-
file. Currently supported additional client arguments are: ``with_locals,
51+
file. Currently supported additional client arguments are: ``include_local_variables,
5252
max_breadcrumbs, release, environment, server_name, shutdown_timeout,
5353
in_app_include, in_app_exclude, default_integrations, dist, sample_rate,
5454
send_default_pii, http_proxy, https_proxy, request_bodies, debug,

sentry/static/description/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
484484
</table>
485485
<p>Other <a class="reference external" href="https://docs.sentry.io/platforms/python/configuration/">client arguments</a> can be
486486
configured by prepending the argument name with <em>sentry_</em> in your Odoo config
487-
file. Currently supported additional client arguments are: <tt class="docutils literal">with_locals,
487+
file. Currently supported additional client arguments are: <tt class="docutils literal">include_local_variables,
488488
max_breadcrumbs, release, environment, server_name, shutdown_timeout,
489489
in_app_include, in_app_exclude, default_integrations, dist, sample_rate,
490490
send_default_pii, http_proxy, https_proxy, request_bodies, debug,

0 commit comments

Comments
 (0)