"RuntimeError: maximum recursion depth exceeded" when accessing User object (app engine patch)

372 views
Skip to first unread message

reyjexter

unread,
Jan 2, 2009, 11:35:37 AM1/2/09
to Google App Engine
i'm not sure if this is the correct place to post this problem. anyway
my problem seems to occur when trying to access the user object.

even when logging the user object stored on request using this simple
code:

import logging
logging.debug(request.user)

and even after adding the code:

import sys
sys.setrecursionlimit(5000)

i'm still getting a recursion error.

this is only thrown when accessing User object. all of my custom
models doesn't seem to throw a recursion error.

i already investigated and tried removing user reference key on all my
models but i'm still getting the error.


hope somebody helps me


thanks

rey


reyjexter

unread,
Jan 2, 2009, 11:51:35 AM1/2/09
to Google App Engine
after further investigating the problem, i noticed that the email
field on the User model is causing the problem. Here is the last few
lines of the trace:

File "/home/jexter/pythonworkspace/myproject/common/appenginepatch/
ragendja/auth/models.py", line 40, in __str__
return unicode(self).encode('utf-8')
File "/usr/local/google_appengine/google/appengine/api/
datastore_types.py", line 556, in __init__
ValidateString(email, 'email')
File "/usr/local/google_appengine/google/appengine/api/
datastore_types.py", line 98, in ValidateString
(name, value, typename(value)))
File "/home/jexter/pythonworkspace/myproject/common/appenginepatch/
ragendja/auth/models.py", line 40, in __str__
return unicode(self).encode('utf-8')
File "/usr/local/google_appengine/google/appengine/api/
datastore_types.py", line 556, in __init__
ValidateString(email, 'email')
File "/usr/local/google_appengine/google/appengine/api/
datastore_types.py", line 98, in ValidateString
(name, value, typename(value)))
File "/home/jexter/pythonworkspace/myproject/common/appenginepatch/
ragendja/auth/models.py", line 40, in __str__
return unicode(self).encode('utf-8')
File "/home/jexter/pythonworkspace/myproject/common/appenginepatch/
ragendja/auth/models.py", line 176, in __unicode__
return self.email
RuntimeError: maximum recursion depth exceeded

So what I did is to manually clear out the entry on email field using
the bundled data viewer. The recursion error went about but i this
error instead:

coercing to Unicode: need string or buffer, NoneType found

Waldemar Kornewald

unread,
Jan 3, 2009, 7:09:23 AM1/3/09
to Google App Engine
Hi,

On Jan 2, 5:51 pm, reyjexter <reyjex...@gmail.com> wrote:
>   File "/home/jexter/pythonworkspace/myproject/common/appenginepatch/
> ragendja/auth/models.py", line 176, in __unicode__
>     return self.email

Please try to change the line above to
return unicode(self.email)

That bug got fixed in the repo a few days ago, but we're not yet ready
for a new release.

Bye,
Waldemar Kornewald
Reply all
Reply to author
Forward
0 new messages