Why does the engine application think that “queries” is a reserved word all of a sudden?

So, I just upgraded to Mavericks, and I suddenly get all kinds of errors:

Basically things like this:

Cannot define property using reserved word 'requests'.

We see this with other properties. None of them are actually reserved words, and they are all defined once (so this is not because they are duplicate properties on the same object or in ReferenceProperty fields)

We have not changed anything (except for updating the OS). We use python2.7 from the application engine log: Python command: /usr/bin/python2.7and we point python27 to app.yaml

This application (with the same property names) has been living for many years, so I’m not sure what is happening. I saw this while trying to configure it on a Linux machine, but just gave up. This time, however, this is my main development machine.

Any ideas?

Longer error:

File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 515, in __init__
_initialize_properties(cls, name, bases, dct)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 425, in _initialize_properties
check_reserved_word(attr_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 319, in check_reserved_word
"definition." % locals())
ReservedWordError: Cannot define property using reserved word 'requests'.
  If you would like to use this name in the datastore consider using a different
  name like requests_ and adding name='requests' to the parameter list of the
  property definition.

UPDATE: downgrading to 2.7.2 seems to fix everything.

+4
source share
1 answer

You should look at the source for "check_reserved_word".
I grabbed the latter and looked into python / google / appengine / ext / db / _init_py

It’s not that queries are a reserved word of Python, it’s queries are now reserved by GoogleAppEngine.

if attr_name in _RESERVED_WORDS or attr_name in dir(Model):
  raise ReservedWordError(
    "Cannot define property using reserved word '%(attr_name)s'. "
    "If you would like to use this name in the datastore consider "
    "using a different name like %(attr_name)s_ and adding "
    "name='%(attr_name)s' to the parameter list of the property "
    "definition." % locals())

, AppEngine "", , _RESERVED_WORDS, dir (Model),

0

All Articles