Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Description
Bug report
I'm contributing onenthought/comtypes.
Incomtypes
, there is atest for the behavior of Excel that is currently skipped. If I comment outtheunittest.skip
marker in that test, it works in Python 3.7 and fails in Python 3.11.
PS ...\comtypes> py -3.7 -m unittest comtypes.test.test_excel -vvtest (comtypes.test.test_excel.Test_EarlyBind) ... oktest (comtypes.test.test_excel.Test_LateBind) ... ok----------------------------------------------------------------------Ran 2 tests in 10.576sOKPS ...\comtypes> py -3.7 -m clear_comtypes_cache -y # <- clear caches, required!Removed directory "...\comtypes\comtypes\gen"Removed directory "...\AppData\Roaming\Python\Python37\comtypes_cache"PS ...\comtypes> py -3.11 -m unittest comtypes.test.test_excel -vv test (comtypes.test.test_excel.Test_EarlyBind.test) ... FAILtest (comtypes.test.test_excel.Test_LateBind.test) ... ok======================================================================FAIL: test (comtypes.test.test_excel.Test_EarlyBind.test)----------------------------------------------------------------------Traceback (most recent call last): File "...\comtypes\comtypes\test\test_excel.py", line 62, in test self.assertEqual(xl.Range["A1:C3"].Value(),AssertionError: Tuples differ: ((None, None, 10.0), ('x', 'y', 'z'), (3.0, 2.0, 1.0)) != ((10.0, 20.0, 31.4), ('x', 'y', 'z'), (3.0, 2.0, 1.0))First differing element 0:(None, None, 10.0)(10.0, 20.0, 31.4)- ((None, None, 10.0), ('x', 'y', 'z'), (3.0, 2.0, 1.0))? ------------+ ((10.0, 20.0, 31.4), ('x', 'y', 'z'), (3.0, 2.0, 1.0))? ++++++++++++----------------------------------------------------------------------Ran 2 tests in 9.640sFAILED (failures=1)
xl.Range[...
callsa prototype-function generated byctypes.WinFunctionType
andctypes.WINFUNCTYPE
.
This is also reported inenthought/comtypes#212 and the test fails in Python 3.8 as well.
A strange callback behavior also occurs with simple COM libraries.
Therefore, I think that this may not be caused by the Excel specification.
There may be other regressions inctypes
callbacks that have also been reported in#82929.
Also, is#97513 a possible solution to this problem?
Any opinions would be appreciated.
Your environment
- CPython versions tested on: Python 3.7.1 and Python 3.11.0
- Windows 10