From f034b4138f85e0e897248fedb67097dc30f71111 Mon Sep 17 00:00:00 2001 From: Martin Jaime Flores Jr Date: Wed, 12 Jun 2024 13:57:15 -0500 Subject: [PATCH] [_204] Naive impl of unknown string type handling --- src/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index da6a79a..763baa2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -566,7 +566,17 @@ static irods::error exec_rule(const irods::default_re_ctx&, const auto rei = get_rei_from_effect_handler(effect_handler); bp::list rule_arguments_python{}; for (auto& cpp_argument : rule_arguments_cpp) { - rule_arguments_python.append(object_from_any(cpp_argument)); + try { + rule_arguments_python.append(object_from_any(cpp_argument)); + } + catch (const bp::error_already_set&) { + // Assume all Unicode Decoding Issues are related to irods/PREP#204 + if (!PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) { + throw; + } + PyErr_Clear(); + rule_arguments_python.append(boost::python::object{}); + } } const bp::object ec = rule_function(rule_arguments_python, CallbackWrapper{effect_handler}, rei);