Unexpected token '<newline>' in a comment

15,680

Line 89:

return jsonify(GetJsonTech(techname)

Is missing a final closing ) at the end so needs changing to

return jsonify(GetJsonTech(techname))
Share:
15,680
Berimbolinho
Author by

Berimbolinho

Updated on June 05, 2022

Comments

  • Berimbolinho
    Berimbolinho almost 2 years

    I'm fairly new to Python and Flask but I'm taking a class and for our final project we are to build a simple site.

    I've added a bunch of routes in my views.py class and I can't for the life of me understand the error. There is nothing after the marker of the error so I can't remove anything. If i remove the full comment the error just keeps moving up. My google-fu has unfortunately betrayed me and thus I finally signed up here instead of just lurking.

    I will post the full views.py as a pastebin: http://pastebin.com/Te6tkD7q

    The problem appears after the comment for the addToJson def on row 92.

    # This function takes in a dictionary and writes those values to the specified database, in this case techDB.json
    

    def addToJson (_dictionary): checkData()

    with open(filename+".json", 'r+') as infile:
        data = json.load(infile)
        infile.close()
        pass
    
    data['techs'].append(_dictionary["techs"][0])
    
    with open(filename+".json", "w") as outfile:
        json.dump(data, outfile)
        outfile.close()
        pass
    
    print("Technique has been added.")
    pass
    

    The project is created in a virtual env using visual studio and Python Tools if that matters at all.

    Thank you for your time

  • Berimbolinho
    Berimbolinho over 7 years
    I'm so embarrased. Thank you very much!
  • Guy
    Guy over 7 years
    @Berimbolinho hopefully that was the issue. Can be hard to see though sometimes, so no problem being a spare pair of eyes!