straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

__repr__ can have an infinite loop if two models have links to each other #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create two models the reference each other
2. get one and call __repr__ on it
3. __repr__ will be called on the reference to the other model which will
call __repr__ back on the first model...and on and on.

What is the expected output? What do you see instead?

A simple 1-2 line repr of the object. Sometimes this will return results
after a long time. Taking len() on one result was 6.7 million characters.
Sometimes it just hangs.

What version of the product are you using? On what operating system?

AEP 1.0.2.2 and Mac OS X 10.5.7 default mac python 2.5.x. Also happens on
previous stable version.

Please provide any additional information below.

I updated __repr__ in common/appenginepatch/appenginepatcher/patch.py to
use unicode instead of repr when getting the values of each field which
solved my issue.

Original issue reported on code.google.com by vari...@gmail.com on 25 Jul 2009 at 1:21

Attachments:

GoogleCodeExporter commented 9 years ago
It should be fixed in the repo, now. Instead of unicode() I show the key for 
ReferenceProperties, so you can still debug the code.

Original comment by wkornew...@gmail.com on 26 Jul 2009 at 12:08