Menu ▾ ▴

Code completion hangs with Python 2.5.1

2007-05-10
2013-03-15
  • Henrik Weber

    Henrik Weber - 2007-05-10

    I'm using pydev 1.3.2 with Eclipse 3.2.2 on Windows XP.

    With Python 2.5, when I type part of a name and press Ctrl+Space, I get the dropdown list for the code completion. When I try the same with Python 2.5.1, Eclipse hangs for a while. When it comes back, nothing at all has happened, especially no dropdown list has appeared.

    I have reinstalled Python 2.5 and code completion works again. Reinstalled 2.5.1, code completion is broken again, so this seems pretty consistent.

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2007-05-10

      Are you testing in an empty file with no tokens or do you have some sample code for it?

       
    • Henrik Weber

      Henrik Weber - 2007-05-11

      For me, it happens in a module as simple as this one:

      class Test(object):
          pass

      Te
        ^
        |
      Put cursor here and press Ctrl+Space.

      With Python 2.5, I get offered the dropdown list, with "Test" right at the top. With Python 2.5.1, Eclipse goes on vacation for a minute or so. When it comes back, it is without a result for the code completion.

      I have found an entry in the error log. It seems that the Python process responsible for the code completion dies for some reason:

      eclipse.buildId=M20060629-1905
      java.version=1.5.0_09
      java.vendor=Sun Microsystems Inc.
      BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
      Command-line arguments:  -os win32 -ws win32 -arch x86
      This is a continuation of log file C:\Programme\Python25\Lib\site-packages\.metadata\.bak_0.log
      Created Time: 2007-04-23 16:29:14.028

      Error
      Fri May 11 09:20:24 CEST 2007
      java.lang.Exception: Error connecting to python process (c:\programme\python25\python.exe "C:\Programme\eclipse\plugins\org.python.pydev_1.3.2\PySrc\pycompletionserver.py" 52000 55352)  - the process in NOT ALIVE anymore (output=0) -  the output of the process is: Std output:
      pycompletionserver will start

      Err output:

      java.lang.RuntimeException: java.lang.Exception: Error connecting to python process (c:\programme\python25\python.exe "C:\Programme\eclipse\plugins\org.python.pydev_1.3.2\PySrc\pycompletionserver.py" 52000 55352)  - the process in NOT ALIVE anymore (output=0) -  the output of the process is: Std output:
      pycompletionserver will start

      Err output:

          at org.python.pydev.editor.codecompletion.PyCodeCompletion.lazyStartShell(PyCodeCompletion.java:329)
          at org.python.pydev.editor.codecompletion.PyCodeCompletion.getCodeCompletionProposals(PyCodeCompletion.java:105)
          at org.python.pydev.editor.codecompletion.PythonCompletionProcessor.getPythonProposals(PythonCompletionProcessor.java:244)
          at org.python.pydev.editor.codecompletion.PythonCompletionProcessor.computeCompletionProposals(PythonCompletionProcessor.java:176)
          at org.python.pydev.editor.simpleassist.SimpleAssistProcessor.computeCompletionProposals(SimpleAssistProcessor.java:145)
          at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1612)
          at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:473)
          at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$17(CompletionProposalPopup.java:470)
          at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:405)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
          at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:399)
          at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1441)
          at org.python.pydev.editor.codecompletion.PyContentAssistant.showPossibleCompletions(PyContentAssistant.java:31)
          at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:777)
          at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1519)
          at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
          at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
          at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
          at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
          at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
          at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461)
          at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
          at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
          at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466)
          at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799)
          at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846)
          at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564)
          at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506)
          at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
          at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:927)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
          at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965)
          at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961)
          at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275)
          at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346)
          at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246)
          at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
          at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
          at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
          at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
          at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
          at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
          at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
          at org.eclipse.core.launcher.Main.run(Main.java:977)
          at org.eclipse.core.launcher.Main.main(Main.java:952)
      Caused by: java.lang.Exception: Error connecting to python process (c:\programme\python25\python.exe "C:\Programme\eclipse\plugins\org.python.pydev_1.3.2\PySrc\pycompletionserver.py" 52000 55352)  - the process in NOT ALIVE anymore (output=0) -  the output of the process is: Std output:
      pycompletionserver will start

      Err output:

          at org.python.pydev.editor.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:437)
          at org.python.pydev.editor.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:311)
          at org.python.pydev.editor.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:233)
          at org.python.pydev.editor.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:191)
          at org.python.pydev.editor.codecompletion.PyCodeCompletion.lazyStartShell(PyCodeCompletion.java:323)
          ... 61 more

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2007-05-11

        Can you run: c:\programme\python25\python.exe "C:\Programme\eclipse\plugins\org.python.pydev_1.3.2\PySrc\pycompletionserver.py" 52000 55352

        in the cmd prompt and say if it gives some exception or some other output (in python 2.5.1)

        Thanks,

        Fabio

         
    • Henrik Weber

      Henrik Weber - 2007-05-14

      With Python 2.5 this gives:
      pycompletionserver will start
      pycompletionserver creating socket
      pycompletionserver waiting for connection

      The program doesn't return to the prompt and I can see a Python process running in the Taskmanager.

      With Python 2.5.1 I get:
      pycompletionserver will start

      and then I'm back on the prompt. The Taskmanager shows a Python process for a moment which then disappears immediately. No exceptions are printed to the console. Is there another place to look for error messages (log file etc.)?

       
    • Henrik Weber

      Henrik Weber - 2007-05-31

      The problem seems to be gone with pydev 1.3.3.

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2007-05-31

        Yeap, there were some optimizations done for the code-completion structure in 1.3.3 ;-)

        Cheers,

        Fabio