Somehow, I’m getting the following error when executing a bit of source code that is stored in an AppEngine db.TextProperty(). It looks like there is a bit of indentation before the first statement, however, when I inspect the stored text, I can’t see this. Also, I called .strip() on all the code before storing it in the datastore
File "...", line 208, in __init__
exec(some_string, g)
File "<string>", line 1
class Agent(object):
^
SyntaxError: invalid syntax
Any suggestions as to what else might cause this? Unicode conversions? Line endings? I’ll update the question as I discover more.
Oh, turns out I had to do a simple line-ending replace on the code before storing it.
The AppEngine SDK doesn’t complain about line-endings, but the production environment wants to have them normalized: