Python Forum
pdb says "SyntaxError: unexpected EOF" on comment
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pdb says "SyntaxError: unexpected EOF" on comment
#1
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.
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to add multi-line comment section? Winfried 1 193 Mar-24-2024, 04:34 PM
Last Post: deanhystad
Question remove all comment ? SpongeB0B 7 1,318 Oct-27-2023, 05:40 PM
Last Post: deanhystad
  Regular Expression search to comment lines of code Gman2233 5 1,660 Sep-08-2022, 06:57 AM
Last Post: ndc85430
  Block comment in Intellij kam_uk 2 2,282 Nov-15-2020, 05:22 PM
Last Post: kam_uk
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,162 Jul-13-2020, 07:05 PM
Last Post: snippsat
  Python 3 Elementtree and Comment First gw1500se 3 3,731 May-25-2020, 09:02 PM
Last Post: gw1500se
  Youtube Comment bot mateusz135 4 65,875 Mar-14-2020, 04:18 PM
Last Post: buran
  SyntaxError: unexpected EOF while parsing donmerch 2 7,048 Oct-15-2018, 05:12 AM
Last Post: wavic
  Help extracting comment data from multiple zip files SoulsKeeper 10 6,122 Sep-10-2018, 10:33 AM
Last Post: SoulsKeeper
  python crontab remove_all(comment="Minute*") vvarrior 1 2,770 Aug-06-2018, 12:39 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020