Eclipse 3.5 on Mac OS X 10.5, PyDev 1.4.8 (though this problem has been occurring for the last several release).
I have an external module "opendirectory" that is a C++-based dll that I import into a PyDev project file. The editor shows all references to symbols in that module as errors.
The Error Log window shows a Java exception being thrown:
java.lang.RuntimeException: Couldn't find END@@ on received string.
at org.python.pydev.editor.codecompletion.shell.AbstractShell.read(AbstractShell.java:641)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.read(AbstractShell.java:661)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.getCompletions(AbstractShell.java:891)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.getTheCompletions(AbstractShell.java:833)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.internalChangePythonPath(AbstractShell.java:823)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.getImportCompletions(AbstractShell.java:779)
at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.getGlobalTokens(CompiledModule.java:272)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.internalGenerateGetCompletionsForModule(AbstractASTManager.java:656)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:482)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:453)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:445)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:437)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.internalGenerateGetCompletionsForModule(AbstractASTManager.java:664)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:482)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:453)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:445)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:437)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.searchOnSameLevelMods(AbstractASTManager.java:811)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.internalGenerateGetCompletionsForModule(AbstractASTManager.java:627)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:482)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:453)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:445)
at org.python.pydev.editor.codecompletion.revisited.modules.AbstractModule.internalGenerateCachedTokens(AbstractModule.java:172)
at org.python.pydev.editor.codecompletion.revisited.modules.AbstractModule.isInGlobalTokens(AbstractModule.java:128)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.markRead(AbstractScopeAnalyzerVisitor.java:959)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.visitAttribute(AbstractScopeAnalyzerVisitor.java:534)
at org.python.pydev.parser.jython.ast.Attribute.accept(Attribute.java:39)
at org.python.pydev.parser.jython.ast.Call.traverse(Call.java:54)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.traverse(AbstractScopeAnalyzerVisitor.java:171)
at com.python.pydev.analysis.visitors.OccurrencesVisitor.traverse(OccurrencesVisitor.java:214)
at org.python.pydev.parser.jython.ast.VisitorBase.visitCall(VisitorBase.java:260)
at com.python.pydev.analysis.visitors.OccurrencesVisitor.visitCall(OccurrencesVisitor.java:193)
at org.python.pydev.parser.jython.ast.Call.accept(Call.java:49)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.visitAssign(AbstractScopeAnalyzerVisitor.java:651)
at com.python.pydev.analysis.visitors.OccurrencesVisitor.visitAssign(OccurrencesVisitor.java:169)
at org.python.pydev.parser.jython.ast.Assign.accept(Assign.java:32)
at org.python.pydev.parser.jython.ast.For.traverse(For.java:55)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.traverse(AbstractScopeAnalyzerVisitor.java:171)
at com.python.pydev.analysis.visitors.OccurrencesVisitor.traverse(OccurrencesVisitor.java:214)
at org.python.pydev.parser.jython.ast.VisitorBase.visitFor(VisitorBase.java:80)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.visitFor(AbstractScopeAnalyzerVisitor.java:636)
at org.python.pydev.parser.jython.ast.For.accept(For.java:44)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.visitFunctionDef(AbstractScopeAnalyzerVisitor.java:316)
at org.python.pydev.parser.jython.ast.FunctionDef.accept(FunctionDef.java:49)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.visitClassDef(AbstractScopeAnalyzerVisitor.java:202)
at org.python.pydev.parser.jython.ast.ClassDef.accept(ClassDef.java:61)
at org.python.pydev.parser.jython.ast.Module.traverse(Module.java:34)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.traverse(AbstractScopeAnalyzerVisitor.java:171)
at com.python.pydev.analysis.visitors.OccurrencesVisitor.traverse(OccurrencesVisitor.java:214)
at org.python.pydev.parser.jython.ast.VisitorBase.visitModule(VisitorBase.java:8)
at org.python.pydev.parser.jython.ast.Module.accept(Module.java:27)
at com.python.pydev.analysis.OccurrencesAnalyzer.analyzeDocument(OccurrencesAnalyzer.java:50)
at com.python.pydev.analysis.OccurrencesAnalyzer.analyzeDocument(OccurrencesAnalyzer.java:38)
at com.python.pydev.analysis.builder.AnalysisBuilderRunnable.doAnalysis(AnalysisBuilderRunnable.java:223)
at com.python.pydev.analysis.builder.AbstractAnalysisBuilderRunnable.run(AbstractAnalysisBuilderRunnable.java:125)
at com.python.pydev.analysis.builder.AnalysisBuilderVisitor$3.run(AnalysisBuilderVisitor.java:180)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
I turned on PyDev logging and got the following details in my console when opening the python file that imports my external module:
AbstractShell: Synchronizing on shells...
AbstractShell: Getting shell related to:Python id:1
AnalysisBuilderRunnable: Created new builder: com.python.pydev.analysis.builder.AnalysisBuilderRunnable@1f5a3dd for:twistedcaldav.directory.appleopendirectory -- Parser -- Factory: changed
AnalysisBuilderRunnable: doAnalysis() - twistedcaldav.directory.appleopendirectory Parser
AdditionalProjectInterpreterInfo: Removing ast info from: twistedcaldav.directory.appleopendirectory
AdditionalProjectInterpreterInfo: Adding ast info to: twistedcaldav.directory.appleopendirectory
AnalysisBuilderRunnable: makeAnalysis:true analysisCause: Parser -- twistedcaldav.directory.appleopendirectory
ASTManager: internalGenerateGetCompletionsForModule: twisted.internet.threads --
ASTManager: getGlobalCompletions: twisted.internet.threads --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twisted.cred.credentials --
ASTManager: getGlobalCompletions: twisted.cred.credentials --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twisted.web2.auth.digest --
ASTManager: getGlobalCompletions: twisted.web2.auth.digest --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.__init__ --
ASTManager: getGlobalCompletions: twistedcaldav.directory.__init__ --
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.__init__ --
ASTManager: getGlobalCompletions: twistedcaldav.directory.__init__ --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.cachingdirectory --
ASTManager: getGlobalCompletions: twistedcaldav.directory.cachingdirectory --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.cachingdirectory --
ASTManager: getGlobalCompletions: twistedcaldav.directory.cachingdirectory --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.directory --
ASTManager: getGlobalCompletions: twistedcaldav.directory.directory --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.directory --
ASTManager: getGlobalCompletions: twistedcaldav.directory.directory --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.directory --
ASTManager: getGlobalCompletions: twistedcaldav.directory.directory --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.directory --
ASTManager: getGlobalCompletions: twistedcaldav.directory.directory --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.principal --
ASTManager: getGlobalCompletions: twistedcaldav.directory.principal --
ASTManager: getBuiltinCompletions
ASTManager: END getBuiltinCompletions
ASTManager: internalGenerateGetCompletionsForModule: opendirectory --
ASTManager: getGlobalCompletions: opendirectory --
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.directory -- DirectoryService
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.directory -- LoggingMixIn
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.log -- LoggingMixIn
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.log -- object
ASTManager: internalGenerateGetCompletionsForModule: __builtin__ -- object
ASTManager: internalGenerateGetCompletionsForModule: dsquery -- expression
ASTManager: internalGenerateGetCompletionsForModule: dsquery -- object
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.__init__ -- augment
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.augment --
ASTManager: getGlobalCompletions: twistedcaldav.directory.augment --
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.__init__ -- augment.AugmentService
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.augment -- AugmentService
ASTManager: internalGenerateGetCompletionsForModule: __builtin__ -- AugmentService
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.augment -- AugmentDB
ASTManager: internalGenerateGetCompletionsForModule: twistedcaldav.directory.augment -- object
AnalysisBuilderRunnable: Adding markers for module: twistedcaldav.directory.appleopendirectory
This module used to import fine in earlier versions of PyDev.