Thanks for the patch. In principle this seems reasonable. Could you please submit a new patch generated with "-c", otherwise it might apply incorrectly. It looks like you should also VariantClear(&varValue)? Finally, can you please give some indication of how this bug manifests itself? My intent is to get something added to the test suite which demonstrates how things go wrong now, and how this patch fixes them. Looking at the patch, it looks simply like a huge constant value in an IDL should be able to provoke it.
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Checking in TestSources/PyCOMTest/PyCOMImpl.cpp; new revision: 1.14; previous revision: 1.13
Checking in TestSources/PyCOMTest/PyCOMImpl.h; new revision: 1.13; previous revision: 1.12
Checking in TestSources/PyCOMTest/PyCOMTest.idl; new revision: 1.14; previous revision: 1.13
Checking in win32com/client/genpy.py; new revision: 1.51; previous revision: 1.50
Checking in win32com/servers/test_pycomtest.py; new revision: 1.12; previous revision: 1.11
Checking in win32com/src/oleargs.cpp; new revision: 1.37; previous revision: 1.36
Checking in win32com/src/extensions/PyVARDESC.cpp; new revision: 1.2; previous revision: 1.1
Checking in win32com/test/testPyComTest.py; new revision: 1.26; previous revision: 1.25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=14198
Originator: NO
Thanks for the patch. In principle this seems reasonable. Could you please submit a new patch generated with "-c", otherwise it might apply incorrectly. It looks like you should also VariantClear(&varValue)? Finally, can you please give some indication of how this bug manifests itself? My intent is to get something added to the test suite which demonstrates how things go wrong now, and how this patch fixes them. Looking at the patch, it looks simply like a huge constant value in an IDL should be able to provoke it.
Cheers
Logged In: YES
user_id=14198
Originator: NO
Sorry - I meant "diff -u" not "-c"
Logged In: YES
user_id=1616
Originator: YES
I've got a test case cobbled together and updated the patch to call VariantClear().
The only problem is that the testcase doesn't automatically detect breakage because of the cache in the site-packages\win32com\gen_py directory.
Is there something special when running the tests that you need to do to get it to regenerate the cached interfaces?
Logged In: YES
user_id=1616
Originator: YES
File Added: pywin32.patch
Updated patch with VariantClear and test cases
Logged In: YES
user_id=14198
Originator: NO
Excellent - thanks!
Checking in TestSources/PyCOMTest/PyCOMImpl.cpp; new revision: 1.14; previous revision: 1.13
Checking in TestSources/PyCOMTest/PyCOMImpl.h; new revision: 1.13; previous revision: 1.12
Checking in TestSources/PyCOMTest/PyCOMTest.idl; new revision: 1.14; previous revision: 1.13
Checking in win32com/client/genpy.py; new revision: 1.51; previous revision: 1.50
Checking in win32com/servers/test_pycomtest.py; new revision: 1.12; previous revision: 1.11
Checking in win32com/src/oleargs.cpp; new revision: 1.37; previous revision: 1.36
Checking in win32com/src/extensions/PyVARDESC.cpp; new revision: 1.2; previous revision: 1.1
Checking in win32com/test/testPyComTest.py; new revision: 1.26; previous revision: 1.25