Python Forum

Full Version: pdb says "SyntaxError: unexpected EOF" on comment
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have seen several examples of .pdbrc files containing comment lines starting with '#'. When I try to do the same, I get this error message:
*** SyntaxError: unexpected EOF while parsing

Too simplify as much as possible, I deleted my .pdbrc file and started a pdb session from the command line like so:

<my_prompt> python -m pdb <my_script>.py
[2] > <my_script_path>(6)<module>()
-> """

(The """ after -> looks suspicious - what is it?)
I then tried a comment interactively:

(Pdb) # comment
*** SyntaxError: unexpected EOF while parsing
(Pdb)

As you can see, I get the same error here too. What is wrong?
My python version is 3.7.0.
Does it work as expected with a very simple test file? Something like the whole file being just one line of print("test")? Let's try to narrow down where the problem is, with pdb or with your script.