[pywin32-bugs] [ pywin32-Bugs-1582720 ] Python long integers aren't translated to Variant/long
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2007-08-27 08:39:58
|
Bugs item #1582720, was opened at 2006-10-23 19:02 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582720&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Matt (matthiaskirst) Assigned to: Nobody/Anonymous (nobody) Summary: Python long integers aren't translated to Variant/long Initial Comment: Since Version 208 Python long integers are not translated to Variant/long type anymore. I think that is on purpose since long integers have undefined precision. But isn't it possible to gracefully convert to Variant/ long like in the versions up to 207? Maybe there is existing code around that can be broken by the above mentioned behaviour (like my one). Test code: import pythoncom class Test: _public_methods_ = [ 'Test' ] _reg_progid_ = "Python.COMTest3" _reg_clsid_ = "{2D7DD06A-83D3-4F31-848C- 57AFA22A650D}" _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER def Test( self ): a = long( 0 ) return a if __name__ == "__main__": import win32com.server.register print "Registering..." win32com.server.register.UseCommandLine( Test ) In VB: Private Sub Form_Load() Dim p As Object Dim a Set p = CreateObject("Python.COMTest3") a = p.Test() End Sub ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2007-08-27 18:39 Message: Logged In: YES user_id=14198 Originator: NO Yes, we should still use VT_I4 if the value fits, and I broke that. I just fixed it, so your example should work again in the next build. Checking in com/win32com/src/oleargs.cpp; new revision: 1.39; previous revision: 1.38 ---------------------------------------------------------------------- Comment By: yiwamoto (yiwamoto) Date: 2006-12-12 21:59 Message: Logged In: YES user_id=1666448 Originator: NO I supporse this problem occurs under VB(VBA) only. Since version 208, type conversion(Python type --> COM variant type) program uses 'VT_UI4'(unsigned int) COM variant type instead of 'VT_I4'(signed int). But, VB(VBA) don't support unsigned int type. I don't know how to solve this problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582720&group_id=78018 |