#30487: Using more than 245 functions in CombinedExpressions causes 
RecursionError
-------------------------------------+-------------------------------------
               Reporter:  M1ha Shvn  |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  2.1
  layer (models, ORM)                |       Keywords:  recursion function
               Severity:  Normal     |  Func
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Hi.
 When I try to concatenate more than 245 values into
 django.db.models.expressions.CombinedExpression I get RecursionError
 "RecursionError: maximum recursion depth exceeded".

 A simple example to reproduce:

 {{{
 from django.db.models import F
 item = F('test')
 for i in range(300):
     item += F('test')
 print(item)
 }}}
 returns

 {{{
 Traceback (most recent call last):
   File "/usr/lib/python3.7/code.py", line 90, in runcode
     exec(code, self.locals)
   File "<input>", line 5, in <module>
   File "/home/vagrant/venv/lib/python3.7/site-
 packages/django/db/models/expressions.py", line 404, in __str__
     return "{} {} {}".format(self.lhs, self.connector, self.rhs)
   File "/home/vagrant/venv/lib/python3.7/site-
 packages/django/db/models/expressions.py", line 404, in __str__
     return "{} {} {}".format(self.lhs, self.connector, self.rhs)
   File "/home/vagrant/venv/lib/python3.7/site-
 packages/django/db/models/expressions.py", line 404, in __str__
     return "{} {} {}".format(self.lhs, self.connector, self.rhs)
   [Previous line repeated 244 more times]
 RecursionError: maximum recursion depth exceeded
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30487>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.8d86b5d045bb2fd2d215718da9c9f0b5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to