Menu ▾ ▴

Debugging problems

2008-11-12
2013-03-15
  • Svein Hansen

    Svein Hansen - 2008-11-12

    Hi

    First, let me thank you for your great work on pydev!

    Everything worked fine two or three version of pydev ago. I have now re-installed my development environment and are no longer able to debug my python code.

    The installation of pydev goes fine into eclipse using the update site.

    Symptom 1:

    PYDEV DEBUGGER WARNING:
    sys.settrace() should not be used when the debugger is being used.
    This may cause the debugger to stop working correctly.
    If this is needed, please check:
    http://pydev.blogspot.com/2007/06/why-cant-pydev-debugger-work-with.html
    to see how to restore the debug tracing back correctly.
    Call Location:
      File "/usr/lib/python2.5/site-packages/twisted/internet/process.py", line 353, in __init__
        sys.settrace(None)

    Breakpoints does not work.
    The link to blogspot if fairly old (from 2007) and I did not see this error 2 months ago :-)

    Symptom 2:
    When starting the debugger I sometimes get an errormessage stating that the breakpoint cannot be set, and the error message is "UTF-8"

    Any ideas?

    Thanks!

    -sveinh

    Environment:

    * Eclipse:
    Version: 3.4.1
    Build id: M20080911-1700

    * pydev
    Version 1.3.24

    * Python
    Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)

    * Platform
    Ubuntu 8.04.1 Desktop

     
    • Svein Hansen

      Svein Hansen - 2008-11-12

      Forgot to include bzr version:

      Bazaar (bzr) 1.9
        Python interpreter: /usr/bin/python 2.5.2
        Python standard library: /usr/lib/python2.5
        bzrlib: /usr/lib/python2.5/site-packages/bzrlib

      After some more investigation, I also include a stack-trace from the .log file:

      !ENTRY org.eclipse.debug.core 4 120 2008-11-12 23:32:41.750
      !MESSAGE An exception occurred during breakpoint change notification.
      !STACK 0
      java.nio.charset.IllegalCharsetNameException: utf-8;
          at java.nio.charset.Charset.checkName(Charset.java:285)
          at java.nio.charset.Charset.lookup2(Charset.java:459)
          at java.nio.charset.Charset.lookup(Charset.java:438)
          at java.nio.charset.Charset.isSupported(Charset.java:480)
          at org.python.pydev.core.REF.getValidEncoding(REF.java:878)
          at org.python.pydev.core.REF.getPythonFileEncoding(REF.java:853)
          at org.python.pydev.core.REF.getPythonFileEncoding(REF.java:777)
          at org.python.pydev.core.REF.getCustomReturnFromFile(REF.java:652)
          at org.python.pydev.core.REF.getDocFromFile(REF.java:612)
          at org.python.pydev.core.REF.getDocFromFile(REF.java:554)
          at org.python.pydev.editor.codecompletion.revisited.modules.AbstractModule.createModule(AbstractModule.java:235)
          at org.python.pydev.editor.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:498)
          at org.python.pydev.editor.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:410)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModuleInDirectManager(ProjectModulesManager.java:317)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModuleAndRelatedModulesManager(ProjectModulesManager.java:290)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModule(ProjectModulesManager.java:257)
          at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getModule(AbstractASTManager.java:344)
          at org.python.pydev.debug.model.PyBreakpoint.getFunctionName(PyBreakpoint.java:192)
          at org.python.pydev.debug.model.AbstractDebugTarget.breakpointAdded(AbstractDebugTarget.java:259)
          at org.eclipse.debug.internal.core.BreakpointManager$BreakpointNotifier.run(BreakpointManager.java:876)
          at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
          at org.eclipse.debug.internal.core.BreakpointManager$BreakpointNotifier.notify(BreakpointManager.java:902)
          at org.eclipse.debug.internal.core.BreakpointManager.fireUpdate(BreakpointManager.java:816)
          at org.eclipse.debug.internal.core.BreakpointManager.addBreakpoints(BreakpointManager.java:535)
          at org.eclipse.debug.internal.core.BreakpointManager.addBreakpoints(BreakpointManager.java:505)
          at org.eclipse.debug.internal.core.BreakpointManager.addBreakpoint(BreakpointManager.java:498)
          at org.python.pydev.debug.ui.actions.BreakpointRulerAction$1.run(BreakpointRulerAction.java:126)
          at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
          at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
          at org.python.pydev.debug.ui.actions.BreakpointRulerAction.addMarker(BreakpointRulerAction.java:130)
          at org.python.pydev.debug.ui.actions.BreakpointRulerAction.run(BreakpointRulerAction.java:73)
          at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
          at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.runWithEvent(AbstractRulerActionDelegate.java:113)
          at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
          at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
          at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
          at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
          at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
          at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
          at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
          at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
          at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
          at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
          at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
          at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

      !ENTRY org.python.pydev 4 4 2008-11-12 23:32:46.484
      !MESSAGE utf-8;
      !STACK 0
      java.nio.charset.IllegalCharsetNameException: utf-8;
          at java.nio.charset.Charset.checkName(Charset.java:285)
          at java.nio.charset.Charset.lookup2(Charset.java:459)
          at java.nio.charset.Charset.lookup(Charset.java:438)
          at java.nio.charset.Charset.isSupported(Charset.java:480)
          at org.python.pydev.core.REF.getValidEncoding(REF.java:878)
          at org.python.pydev.core.REF.getPythonFileEncoding(REF.java:853)
          at org.python.pydev.core.REF.getPythonFileEncoding(REF.java:766)
          at org.python.pydev.editor.PyEdit.fixEncoding(PyEdit.java:673)
          at org.python.pydev.editor.PyEdit.doSetInput(PyEdit.java:587)
          at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3026)
          at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:458)
          at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:366)
          at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:758)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
          at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:755)
          at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2487)
          at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3044)
          at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3071)
          at org.python.pydev.editor.PyEdit.init(PyEdit.java:475)
          at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:799)
          at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:643)
          at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)
          at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
          at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:266)
          at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2820)
          at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2729)
          at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2721)
          at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2673)
          at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
          at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2668)
          at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2652)
          at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2635)
          at org.eclipse.ui.ide.IDE.openEditor(IDE.java:678)
          at org.python.pydev.navigator.actions.PyOpenResourceAction.openFiles(PyOpenResourceAction.java:33)
          at org.python.pydev.navigator.actions.PyOpenPythonFileAction.run(PyOpenPythonFileAction.java:70)
          at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
          at org.eclipse.ui.internal.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:184)
          at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
          at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
          at org.eclipse.core.runtime.Platform.run(Platform.java:880)
          at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
          at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
          at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
          at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
          at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:372)
          at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1183)
          at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
          at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
          at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401)
          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
          at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
          at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
          at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
          at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
          at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
          at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
          at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
          at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
          at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2008-11-16

        Actually, that error happens because of the ';' (Semicolon) from the utf-8; in the file you're trying to open, but that is just a report... Pydev should recover gracefully from that.

        The original problem you seem to be having is that the sys.settrace function is being called from the code you want to debug. When a given code needs to use the tracing facility (which is intended for debuggers) the debugger won't work... So, you must either make the code stop using the settrace or if really needed make it use pydevd_tracing.SetTrace (at which point your code will stop being debugged) and then restore it later as specified at http://pydev.blogspot.com/2007/06/why-cant-pydev-debugger-work-with.html.

        Cheers,

        Fabio