Menu

#75 Use the specified type for constant values

closed-fixed
nobody
None
5
2007-02-07
2007-02-02
No

When parsing constant types from the Type Library, the value can be casted incorrectly when converting unsigned integers to python types.

Discussion

  • Mark Hammond

    Mark Hammond - 2007-02-05

    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

     
  • Mark Hammond

    Mark Hammond - 2007-02-05

    Logged In: YES
    user_id=14198
    Originator: NO

    Sorry - I meant "diff -u" not "-c"

     
  • Brandon Ehle

    Brandon Ehle - 2007-02-07

    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?

     
  • Brandon Ehle

    Brandon Ehle - 2007-02-07

    Logged In: YES
    user_id=1616
    Originator: YES

    File Added: pywin32.patch

     
  • Brandon Ehle

    Brandon Ehle - 2007-02-07

    Updated patch with VariantClear and test cases

     
  • Mark Hammond

    Mark Hammond - 2007-02-07
    • status: open --> closed-fixed
     
  • Mark Hammond

    Mark Hammond - 2007-02-07

    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

     

Log in to post a comment.