Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"a foreign function that will call a COM method" generated byctypes.WINFUNCTYPE works in Python3.7, does not work as same in newer Python #99952

Closed
Assignees
gpshead
Labels
3.10only security fixes3.11only security fixes3.12only security fixestopic-ctypestype-bugAn unexpected behavior, bug, or error
@junkmd

Description

@junkmd

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

Linked PRs

Metadata

Metadata

Assignees

Labels

3.10only security fixes3.11only security fixes3.12only security fixestopic-ctypestype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp