jazzband / django-floppyforms

Full control of form rendering in the templates.
http://django-floppyforms.readthedocs.org/
Other
839 stars 145 forks source link

Endless Loop with django-debug-toolbar #198

Closed gudi1989 closed 4 years ago

gudi1989 commented 7 years ago

Python 3.5 Django == 1.11.1 django-floppyforms <= 1.7.1.dev1 django-debug-toolbar==1.8

When I open a page with a form, the server ends with the following output.

Fatal Python error: Cannot recover from stack overflow.

Thread 0x00007f36409c6700 (most recent call first):
  File "/usr/lib/python3.5/socket.py", line 576 in readinto
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 140 in handle
  File "/usr/lib/python3.5/socketserver.py", line 681 in __init__
  File "/usr/lib/python3.5/socketserver.py", line 354 in finish_request
  File "/usr/lib/python3.5/socketserver.py", line 625 in process_request_thread
  File "/usr/lib/python3.5/threading.py", line 862 in run
  File "/usr/lib/python3.5/threading.py", line 914 in _bootstrap_inner
  File "/usr/lib/python3.5/threading.py", line 882 in _bootstrap

Thread 0x00007f36411c7700 (most recent call first):
  File "/usr/lib/python3.5/socket.py", line 576 in readinto
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 140 in handle
  File "/usr/lib/python3.5/socketserver.py", line 681 in __init__
  File "/usr/lib/python3.5/socketserver.py", line 354 in finish_request
  File "/usr/lib/python3.5/socketserver.py", line 625 in process_request_thread
  File "/usr/lib/python3.5/threading.py", line 862 in run
  File "/usr/lib/python3.5/threading.py", line 914 in _bootstrap_inner
  File "/usr/lib/python3.5/threading.py", line 882 in _bootstrap

Thread 0x00007f36419c8700 (most recent call first):
  File "/usr/lib/python3.5/socket.py", line 576 in readinto
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 140 in handle
  File "/usr/lib/python3.5/socketserver.py", line 681 in __init__
  File "/usr/lib/python3.5/socketserver.py", line 354 in finish_request
  File "/usr/lib/python3.5/socketserver.py", line 625 in process_request_thread
  File "/usr/lib/python3.5/threading.py", line 862 in run
  File "/usr/lib/python3.5/threading.py", line 914 in _bootstrap_inner
  File "/usr/lib/python3.5/threading.py", line 882 in _bootstrap

Thread 0x00007f36421c9700 (most recent call first):
  File "/usr/lib/python3.5/socket.py", line 576 in readinto
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 140 in handle
  File "/usr/lib/python3.5/socketserver.py", line 681 in __init__
  File "/usr/lib/python3.5/socketserver.py", line 354 in finish_request
  File "/usr/lib/python3.5/socketserver.py", line 625 in process_request_thread
  File "/usr/lib/python3.5/threading.py", line 862 in run
  File "/usr/lib/python3.5/threading.py", line 914 in _bootstrap_inner
  File "/usr/lib/python3.5/threading.py", line 882 in _bootstrap

Thread 0x00007f36429ca700 (most recent call first):
  File "/usr/lib/python3.5/socket.py", line 576 in readinto
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 140 in handle
  File "/usr/lib/python3.5/socketserver.py", line 681 in __init__
  File "/usr/lib/python3.5/socketserver.py", line 354 in finish_request
  File "/usr/lib/python3.5/socketserver.py", line 625 in process_request_thread
  File "/usr/lib/python3.5/threading.py", line 862 in run
  File "/usr/lib/python3.5/threading.py", line 914 in _bootstrap_inner
  File "/usr/lib/python3.5/threading.py", line 882 in _bootstrap

Current thread 0x00007f36431cb700 (most recent call first):
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/text.py", line 413 in unescape_string_literal
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/functional.py", line 219 in wrapper
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 835 in __init__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/templatetags/floppyforms.py", line 264 in parse_variables
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/templatetags/floppyforms.py", line 333 in parse
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 513 in parse
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 230 in compile_nodelist
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 191 in __init__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/loaders/base.py", line 44 in get_template
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/engine.py", line 136 in find_template
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/engine.py", line 162 in get_template
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 39 in get_template
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/loader.py", line 21 in get_template
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 16 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 209 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/templatetags/floppyforms.py", line 552 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 957 in render_annotated
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 990 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 107 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 209 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/templatetags/floppyforms.py", line 552 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 957 in render_annotated
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 990 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 107 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 209 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/templatetags/floppyforms.py", line 552 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 957 in render_annotated
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 990 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 107 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 21 in _render_as
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/floppyforms/forms.py", line 24 in __str__
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/encoding.py", line 76 in force_text
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py", line 128 in _store_template_info
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in <listcomp>
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 193 in send
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/test/utils.py", line 106 in instrumented_test_render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/base.py", line 207 in render
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/template/backends/django.py", line 66 in render
  ...

Thread 0x00007f3648aeb700 (most recent call first):
  File "/usr/lib/python3.5/selectors.py", line 376 in select
  File "/usr/lib/python3.5/socketserver.py", line 232 in serve_forever
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 174 in run
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 149 in inner_run
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/autoreload.py", line 227 in wrapper

Thread 0x00007f3666109700 (most recent call first):
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/autoreload.py", line 281 in reloader_thread
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/autoreload.py", line 298 in python_reloader
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/utils/autoreload.py", line 332 in main
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 110 in run
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 101 in handle
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/base.py", line 330 in execute
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 62 in execute
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/base.py", line 283 in run_from_argv
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 355 in execute
  File "/home/mgutmair/work/hogapage/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 363 in execute_from_command_line
  File "/home/mgutmair/work/hogapage/web/manage.py", line 23 in <module>

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

It only happens when I have activated templates in the DJDT.

darwing1210 commented 7 years ago

Adding this to DEBUG_TOOLBAR_CONFIG is a temporal fix:

'SKIP_TEMPLATE_PREFIXES': (
    'django/forms/widgets/',
    'admin/widgets/',
    'floppyforms/'
),
rtpg commented 4 years ago

closing this as it dates from a while ago. and there have been pretty deep changes to the code in this area in 1.8.0. Please re-open if necesary