[Libreoffice-bugs] [Bug 92848] shape.String gives an exception in TableShape with PyUno

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Oct 31 09:59:33 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=92848

--- Comment #18 from Mike Kaganski <mikekaganski at hotmail.com> ---
Since [1] (Python 3.2+), Python only tests for AttributeError in its hasattr().
Thus, returning other types of errors (as is done in our PyUno implementation
[2]) would give wrong results. Still, it's not enough to just always return
AttributeError from PyUNO_getattr: this will defeat the idea behind the Python
change (see [3]). In this case, an interface is found that has the property
(com.sun.star.text.XTextAppend), and its getter is attempted on the passed
object, which is queried for that interface to do that. The query fails in
IdlReflectionServiceImpl::mapToUno (more precisely, in extract() called there),
and generic RuntimeException is thrown. It's unclear (to me) how to handle that
here.

[1] https://hg.python.org/cpython/rev/2de9d4457082/
[2]
https://git.libreoffice.org/core/+/08c3c504644ee978c2ec75ba083765b6ffddf08c/pyuno/source/module/pyuno.cxx#1378
[3]
https://stackoverflow.com/questions/35566680/pythons-hasattr-sometimes-returns-incorrect-results

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20181031/a4743952/attachment.html>


More information about the Libreoffice-bugs mailing list