[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
Reviewed: https://review.opendev.org/750216 Committed: https://git.openstack.org/cgit/openstack/oslo.utils/commit/?id=632f15515fb224863c1027c658858c595ad5d11b Submitter: Zuul Branch:master commit 632f15515fb224863c1027c658858c595ad5d11b Author: Ghanshyam Mann Date: Mon Sep 7 16:15:20 2020 -0500 Fix is_same_callback() testing for python3.8 Python3.8 onwards, comparision of bound methods is changed. It no longer decide the bound method's equality based on their bounded objects equality instead it checks the identity of their '__self__'. Details about this behavior change in python 3.8 - https://bugs.python.org/issue1617161 - python-dev discussion: https://mail.python.org/pipermail/python-dev/2018-June/153959.html So python3.8 onwards, 'strict' arg has no meaning. For backward compatibility for python <3.8, we can keep the 'strict' arg but with deprecation warning. Also modify the is_same_callback() unit tests to verify the 'strict' arg based on python version. Change-Id: I3e6d9bbceccacddd0e1a514bbe5d0722a3408ecb Closes-Bug: #1841072 ** Changed in: oslo.utils Status: In Progress => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
Fix proposed to branch: master Review: https://review.opendev.org/750216 ** Changed in: oslo.utils Status: Confirmed => In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
This was considered as bugfix in python 3.8 because bound methods should only be equal if they are bound on the same instance, not if their instances are equal. In Python <= 3.7 the bound method equality calls the equivalent of instance1 == instance2 and return true based on that and while in Python 3.8 it checks if instance1 is instance2. You can see details about this behavior change in py3.8 - https://bugs.python.org/issue1617161 - python-dev discussion: https://mail.python.org/pipermail/python-dev/2018-June/153959.html With that and for cases of 'strict=False', oslo utils is_same_callback() method behaviour also changed. With 'strict=False', this method returned *True* for python <3.7 (because == comparison used to call the __eq__ method return value) and *False* for python3.8 onwards (because == never call __eq__ method and check the id of self). -https://github.com/openstack/oslo.utils/blob/7c4a94c0c3fcbd8f05541944851728f30deadd9b/oslo_utils/reflection.py#L172-L174 For 'strict' is True (which is the default) there is no behavior change because is_same_callback() method checks if 'self' of both bound methods are equal or not - https://github.com/openstack/oslo.utils/blob/7c4a94c0c3fcbd8f05541944851728f30deadd9b/oslo_utils/reflection.py#L183 We should modify the test to test the behaviors this way and in is_same_callback() method we should clearly document that 'strict' is no more an option or valid thing for python3.8 onwards and we should even deprecate this arg itself. ** Bug watch added: Python Roundup #1617161 http://bugs.python.org/issue1617161 ** Changed in: oslo.utils Status: New => Confirmed ** Changed in: oslo.utils Assignee: (unassigned) => Ghanshyam Mann (ghanshyammann) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
** Changed in: python3-defaults (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
This bug was fixed in the package python-oslo.utils - 3.41.1-0ubuntu2 --- python-oslo.utils (3.41.1-0ubuntu2) focal; urgency=medium * Non-strict relfection comparison is not possible in py3.8+. LP: #1841072 * Use python3 when detecting module name from setup.py in autopkgtest. -- Dimitri John Ledkov Mon, 18 Nov 2019 11:23:18 + ** Changed in: python-oslo.utils (Ubuntu) Status: New => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
I think actually strict can be dropped. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
** Patch added: "py38.patch" https://bugs.launchpad.net/ubuntu/+source/python-oslo.utils/+bug/1841072/+attachment/5306166/+files/py38.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1841072] Re: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8
This bug now blocks updating python-3-defaults. ** Also affects: python-oslo.utils (Ubuntu) Importance: Undecided Status: New ** Tags added: update-excuse ** Also affects: python3-defaults (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1841072 Title: test_reflection.CallbackEqualityTest.test_different_instance_callbacks fails on Python 3.8 To manage notifications about this bug go to: https://bugs.launchpad.net/oslo.utils/+bug/1841072/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs