From c9ae3adc24cfa7f39b2d96c87f77be10a8aa475d Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Wed, 30 Apr 2025 16:23:13 -0400 Subject: [PATCH] fix: Use correct default for unsafely param (#36638) `unsafely` should be a boolean, not None. I believe this is what was causing a 400 in remote codejail-service calls (during darklaunch) when the `calculate_problem_responses_csv.v2` instructor task ran: https://github.com/edx/edx-arch-experiments/issues/1028 There are also places in the code where this member appears to be a scalar property instead of a method, or possibly that's just buggy code that doesn't run. I decided not to touch that in this PR (we're probably going to DEPR the entire unsafe mechanism anyhow) but if this PR doesn't work, that's the next place to look -- because higher up in this file there's a `can_execute_unsafe_code=None` that we could try changing. --- xmodule/capa_block.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmodule/capa_block.py b/xmodule/capa_block.py index 1b2d18cf17..1a096e76b2 100644 --- a/xmodule/capa_block.py +++ b/xmodule/capa_block.py @@ -726,7 +726,7 @@ class _BuiltInProblemBlock( # For the purposes of this report, we don't need to support those use cases. anonymous_student_id=None, cache=None, - can_execute_unsafe_code=lambda: None, + can_execute_unsafe_code=lambda: False, get_python_lib_zip=( lambda: SandboxService(contentstore, self.scope_ids.usage_id.context_key).get_python_lib_zip() ),