[pywin32-bugs] [ pywin32-Bugs-2857273 ] Handling type complex
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2009-09-12 01:50:53
|
Bugs item #2857273, was opened at 2009-09-12 10:02 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2857273&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: None Group: None Status: Closed Resolution: Wont Fix Priority: 5 Private: No Submitted By: no_hope (no_hope) Assigned to: Nobody/Anonymous (nobody) Summary: Handling type complex Initial Comment: I think win32com may not handle Python's complex type correctly. I use win32com client to manipulate variable inside LabVIEW. When I read LabVIEW's complex variable it is returned as a tuple. However, when I try to write to a LabVIEW's complex variable using tuple, I get pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147352571), 2) in ._oleobj_.InvokeTypes as if there is type mismatch. If I supply an object of type complex, win32com is happy but LabVIEW complains (presumably because it wants a tuple). Is it possible that this is a bug since win32com client sometimes uses tuple and sometimes complex for the same object? ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2009-09-12 11:50 Message: Yeah, that exception is a COM error thrown by labview. To be quite honest, I'm not sure what type win32com will attempt to pass in that case, but there is no simple COM type which can represent a complex number ---------------------------------------------------------------------- Comment By: no_hope (no_hope) Date: 2009-09-12 10:17 Message: Then how come win32com gives me an error unless I give it a an object of type complex? Or is pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147352571), 2) LabVIEW's exception, not win32com's? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2009-09-12 10:08 Message: COM doesn't define a complex type, so win32com doesn't either. I've no idea what LabVIEW would be expecting to be passed here - but I'm guessing it uses a simple array of 2 integers or floats, which is what makes you think win32com sometimes uses a tuple. You probably need to ask the labview guys what they use to represent a complex number. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2857273&group_id=78018 |