[pywin32-bugs] [ pywin32-Bugs-1455181 ] makepy fails for "Spotfire.Application"
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2006-03-22 08:35:23
|
Bugs item #1455181, was opened at 2006-03-21 17:43 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1455181&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 Submitted By: newgene (newgene) Assigned to: Nobody/Anonymous (nobody) Summary: makepy fails for "Spotfire.Application" Initial Comment: When I run makepy from "Tools" menu for "Spotfire DecisionSite 8.1 Object library (1.9)", it generate the following error message: ========================================= >>> Generating to C:\Python24\lib\site- packages\win32com\gen_py\EE299BA0-BA43-11D0-96FA- 00A0C9011445x0x1x9.py Failed to execute command: from win32com.client import makepy;makepy.main() Traceback (most recent call last): File "C:\Python24\Lib\site- packages\pythonwin\pywin\framework\toolmenu.py", line 103, in HandleToolCommand exec "%s\n" % pyCmd File "<string>", line 1, in ? File "C:\Python24\lib\site- packages\win32com\client\makepy.py", line 362, in main GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel, bForDemand = bForDemand, bBuildHidden = hiddenSpec) File "C:\Python24\lib\site- packages\win32com\client\makepy.py", line 273, in GenerateFromTypeLibSpec gencache.AddModuleToCache(info.clsid, info.lcid, info.major, info.minor) File "C:\Python24\lib\site- packages\win32com\client\gencache.py", line 550, in AddModuleToCache mod = _GetModule(fname) File "C:\Python24\lib\site- packages\win32com\client\gencache.py", line 629, in _GetModule mod = __import__(mod_name) File "C:\Python24\lib\site- packages\win32com\gen_py\EE299BA0-BA43-11D0-96FA- 00A0C9011445x0x1x9.py", line 6382 def None(self): SyntaxError: assignment to None ============================================= This the piece of the code with syntax error: ========================================= def None(self): """Puts the query device in the None state""" return self._oleobj_.InvokeTypes(3, LCID, 1, (24, 0), (),) ========================================= Apparently, the problem occurs because the name conflict with "None". Somehow makepy.py should be able to catch it and get it around, or just ignore this "None" method. Thanks. Chunlei ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-03-22 19:35 Message: Logged In: YES user_id=14198 You can apply the following patch to win32com\build.py and delete the generated file - or just move back to Python 2.3! I'll check this change in: Index: build.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/build.py,v retrieving revision 1.28 diff -u -r1.28 build.py --- build.py 13 Feb 2005 12:05:46 -0000 1.28 +++ build.py 22 Mar 2006 08:32:18 -0000 @@ -518,6 +518,10 @@ return demunge_leading_underscores(className) elif iskeyword(className): # all keywords are lower case return string.capitalize(className) + elif className == 'None': + # assign to None is evil (and SyntaxError in 2.4) - note + # that if it was a global it would get picked up below + className = 'NONE' elif is_global and __builtins__.has_key(className): # builtins may be mixed case. If capitalizing it doesn't change it, # force to all uppercase (eg, "None", "True" become "NONE", "TRUE" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1455181&group_id=78018 |