milesrichardson / ParsePy

A relatively up-to-date fork of ParsePy, the Python wrapper for the Parse.com API. Originally maintained by @dgrtwo
MIT License
516 stars 184 forks source link

recursion when saving Installation #39

Open sunnyxx opened 10 years ago

sunnyxx commented 10 years ago
installations = Installation.Query.all()
for installation in installations:
    installation.save()

got a RuntimeError: maximum recursion depth exceeded in __instancecheck__

dgrtwo commented 10 years ago

Could you show an excerpt of the traceback?

sunnyxx commented 10 years ago

The whole traceback info:

  File "/Library/Python/2.7/site-packages/parse_rest/datatypes.py", line 267, in save
    return self._update(batch=batch)
  File "/Library/Python/2.7/site-packages/parse_rest/datatypes.py", line 286, in _update
    **self._to_native())
// Recursion ++++
  File "/Library/Python/2.7/site-packages/parse_rest/datatypes.py", line 243, in _to_native
    return ParseType.convert_to_parse(self)
  File "/Library/Python/2.7/site-packages/parse_rest/datatypes.py", line 78, in convert_to_parse
    return python_object._to_native()
// Recursion -----
// ...
// Overflow here
  File "/Library/Python/2.7/site-packages/parse_rest/datatypes.py", line 58, in convert_to_parse
    is_object = isinstance(python_object, Object)
RuntimeError: maximum recursion depth exceeded in __instancecheck__
dgrtwo commented 10 years ago

What is in your Installation object? (What types? Does it have Relations with other objects?) This would appear to be a specific problem with one of your fields (more accurately, with the corresponding DataType in our library) but I can't quite reproduce it.