From: cjw at connection.com (Colin J. Williams)
Date: Mon, 19 Apr 1999 10:32:25 -0400
Subject: Problems with PythonWin debugger & tk
Message-ID: <371B3E79.C7683E94@connection.com>
Content-Length: 2165
X-UID: 1331                                                  

When attempting to use the debugger with the simplest of tk programs, a couple
of problems are observed:

1. An exception is reported when the breakpoint is set.

2. When stepping thro portions of tkinter, the coordination between the source
window and the    debugger are lost after about line 1000.

Below is the source script and the exception report.

Are there known limitations when using the debugger with tkinter stuff?
This script works fine without the debugger.

I would appreciate advise.

Colin W.

''' First test script.

  '''
  
from Tkinter import *
def test():
    root = Tk()

    w = Label(root, text="Hello, world!")
    w.pack()                                       <<<=== Breakpoint here!

    root.mainloop()

if __name__ == '__main__':
  test()

Traceback (innermost last):
  File "E:\Program Files\Python\Pythonwin\pywin\framework\scriptutils.py", line
234, in RunScript
    debugger.run(codeObject, __main__.__dict__)
  File "E:\Program Files\Python\Pythonwin\pywin\debugger\__init__.py", line 38,
in run
    _GetCurrentDebugger().run(cmd, globals,locals)
  File "E:\Program Files\Python\Pythonwin\pywin\debugger\debugger.py", line
988, in run
    debugger_parent.run(self, cmd, globals, locals)
  File "C:\Python\Lib\bdb.py", line 343, in run
    exec cmd in globals, locals
  File "C:\My Files\Python\Tkinter\T1.py", line 15, in ?
    test()
  File "C:\My Files\Python\Tkinter\T1.py", line 7, in test
    root = Tk()
  File "C:\Python\Lib\lib-tk\Tkinter.py", line 910, in __init__
    self.readprofile(baseName, className)
  File "C:\Python\Lib\lib-tk\Tkinter.py", line 929, in readprofile
    exec 'from Tkinter import *' in dir
  File "<string>", line 1, in ?
  File "C:\Python\Lib\bdb.py", line 41, in trace_dispatch
    return self.dispatch_call(frame, arg)
  File "C:\Python\Lib\bdb.py", line 61, in dispatch_call
    if not (self.stop_here(frame) or self.break_anywhere(frame)):
  File "E:\Program Files\Python\Pythonwin\pywin\debugger\debugger.py", line
899, in break_anywhere
    fname = string.lower(win32api.GetFullPathName(frame.f_code.co_filename))
api_error: (161, 'GetFullPathName', 'The specified path is invalid.')





