https://bugs.freedesktop.org/show_bug.cgi?id=46926
Bug #: 46926
Summary: PyUNO structure comparisons broken (always false)
Classification: Unclassified
Product: LibreOffice
Version: LibO 3.5.1 RC1
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: Libreoffice
AssignedTo: [email protected]
ReportedBy: [email protected]
It appears that part of the Python 3 commit
(a09ce46818fd4d5e08b3af9a478501cd8ef5b4fe), where comparisons were switched to
use the rich comparison slot, broke structure comparisons. At least,
structures that compared equal in 3.4.5 no longer do so in 3.5 when using the
internal Python interpreter.
For example, using the internal Python interpreter with 3.5.1RC1:
Python 2.6.1 (r261:67515, Feb 24 2012, 08:33:41)
[GCC 4.2.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import uno
>>> from com.sun.star.style import TabStop
>>> a = TabStop()
>>> b = TabStop()
>>> a==b
False
I haven't figured out precisely what is wrong yet, but a brute force approach
of replacing the newer rich comparison PyUNO_cmp with the older traditional
comparison slot and PyUNO_cmp code appears to work properly (e.g. the same as
3.4.5).
I did notice that the rich comparison version always returns Py_False at the
end, where I think the correct return should be either True/False based on
NE/EQ as an operation. Fixing that has no impact, though since the wrapper
objects only have an __eq__ slot installed (for _uno_struct__eq__), I don't
think it's even possible for the comparison function to be called with Py_NE.
-- David
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs