Menu

pydb exception when using source command

Help
2007-04-19
2012-12-10
  • James B. Reese

    James B. Reese - 2007-04-19

    Hi,

    I have the following two Python files.

    test1.py
    --------------------------
    #!/usr/local/bin/python2.5
    '''
    Doc string for module test1.
    '''
    import test2

    def main():
        print "in test1.py"
        test2.doit()

    if __name__ == "__main__":
        main()
    --------------------------

    test2.py
    --------------------------
    '''
    Doc string for module test2.
    '''
    def doit():
        print "in test2.py"
    --------------------------

    Here's the error I see with pydb. I'm using Python 2.5. The same error occurs under OS X and Solaris 9.

    > pydb test1.py
    (/Users/jreese/Desktop/pydb/test1.py:4):  <module>
    4 '''
    (Pydb) source test2.py
    *** SyntaxError: EOF while scanning triple-quoted string ("'''", line 1)
    *** SyntaxError: invalid syntax ("Doc string for module test2.", line 1)
    *** SyntaxError: EOF while scanning triple-quoted string ("'''", line 1)
    *** SyntaxError: unexpected EOF while parsing ("def doit():", line 1)
    in test2.py
    (Pydb)

    The program runs fine. Any help will be greatly appreciated as this problem makes pydb unusable with most of our Python scripts.

    Jim

     
    • Rocky Bernstein

      Rocky Bernstein - 2007-04-19

      I think you misunderstand what the source command is supposed to do. This command reads and executes debugger commands, not Python commands.

      In CVS, I've modified the documentation and help strings, although the text used to read about the same as the corresponding help text in gdb.

       
    • James B. Reese

      James B. Reese - 2007-04-21

      You are, of course, right. My apologies.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.