pyuno/source/module/pyuno_runtime.cxx |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit de1066081342bcf8fb8ac45042a9a6c9d14ced0a
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue Dec 9 15:51:45 2025 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Dec 10 13:49:08 2025 +0100

    Don't use OUStringBuffer::apendAscii with UTF-8
    
    (Stumbled over this when while preparing
    1e2e9a20a4190140e32e6996ea5fd6c22c71e55f "More exhaustive testing of PyUNO 
type
    mapping based on embindtest" I accidentally forgot the
    
    > from org.libreoffice.embindtest import Exception
    
    in pyuno/qa/pytests/embindtest.py and thus 
PythonTest_pyuno_pytests_embindtest
    would SIGABRT with
    
    > sal/rtl/strtmpl.hxx:122: auto rtl::str::Copy(sal_Unicode *, const char *, 
sal_Int32)::(anonymous class)::operator()(char) const: Assertion 
`rtl::isAscii(static_cast<unsigned char>(c))' failed.
    
    from pyuno::lcl_ExceptionMessage (with reprString being "('error', None,
    -123456, 100.5, 'hä')") while trying to report
    
    > uno.com.sun.star.uno.RuntimeException: Couldn't convert ('error', None, 
-123456, 100.5, 'hä') to a UNO type; caught exception: <class 
'AttributeError'>: 'Exception' object has no attribute 'getTypes', traceback 
follows
    
    .)
    
    Change-Id: I4581061dbfa190266fef98dc670a058d6c98eaaf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195304
    Reviewed-by: Stephan Bergmann <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit d89051d184338470c536ec167236fbe73a5b57c6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195356
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/pyuno/source/module/pyuno_runtime.cxx 
b/pyuno/source/module/pyuno_runtime.cxx
index 103398b9a042..85bbc5039a67 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -606,8 +606,7 @@ lcl_ExceptionMessage(PyObject *const o, OUString 
const*const pWrapped)
 {
     OUStringBuffer buf("Couldn't convert ");
     PyRef reprString( PyObject_Str(o), SAL_NO_ACQUIRE );
-    buf.appendAscii( PyUnicode_AsUTF8(reprString.get()) );
-    buf.append(" to a UNO type");
+    buf.append(pyString2ustring(reprString.get()) + " to a UNO type");
     if (pWrapped)
     {
         buf.append("; caught exception: " + *pWrapped);

Reply via email to