From 8859b8e4cd2ad4d64ee9b965041aeef68872a4c4 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 1 Feb 2022 21:12:49 -0600 Subject: [PATCH] Core: Python translate() wrapper arg correction translate()'s third argument is an optional string used as a comment: "None" is a valid value for this argument (and is indeed the stated default in the documentation), but as originally written it was not accepted, only actual strings were allowed. This commit modifies the format string from "s" to "z", allowing an explicit None argument. --- src/Base/Translate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base/Translate.cpp b/src/Base/Translate.cpp index 2c6db05c5f..0b95e2e204 100644 --- a/src/Base/Translate.cpp +++ b/src/Base/Translate.cpp @@ -83,7 +83,7 @@ Py::Object Translate::translate(const Py::Tuple& args) char *source; char *disambiguation = nullptr; int n=-1; - if (!PyArg_ParseTuple(args.ptr(), "ss|si", &context, &source, &disambiguation, &n)) + if (!PyArg_ParseTuple(args.ptr(), "ss|zi", &context, &source, &disambiguation, &n)) throw Py::Exception(); QString str = QCoreApplication::translate(context, source, disambiguation, n);