This cropped up on a few of our applications today, specifically when we rebuilt some Vagrant boxes. It might be related to #852 since it doesn't crop up on existing Vagrant boxes, meaning I'm wondering if a fresh install of everything means a newer version of an underlying dependency (like sqlparse), although in one case sqlparse was at 0.1.18 and we still ran into the issue.
At any rate, here's more information -- this is on Django 1.9.5, but the same occurs on Django 1.9.7. Let me know if I can provide additional information.
process() missing 1 required positional argument: 'stream'
Request Method: GET
Request URL: http://localhost:8000/security/login/?next=/
Django Version: 1.9.5
Exception Type: TypeError
Exception Value:
process() missing 1 required positional argument: 'stream'
Exception Location: /usr/local/lib/python3.4/dist-packages/sqlparse/engine/filter_stack.py in run, line 29
Python Executable: /usr/bin/python3
Python Version: 3.4.3
Python Path:
['/vagrant',
'/vagrant/src/django-pgcrypto-fields',
'/usr/lib/python3.4',
'/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/usr/lib/python3.4/lib-dynload',
'/usr/local/lib/python3.4/dist-packages',
'/usr/lib/python3/dist-packages']
Server time: Wed, 20 Jul 2016 15:28:01 -0400
Traceback Switch to copy-and-paste view
/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py in get_response
response = middleware_method(request, response) ...
▶ Local vars
/usr/local/lib/python3.4/dist-packages/debug_toolbar/middleware.py in process_response
panel.generate_stats(request, response) ...
▶ Local vars
/usr/local/lib/python3.4/dist-packages/debug_toolbar/panels/sql/panel.py in generate_stats
query['sql'] = reformat_sql(query['sql']) ...
▶ Local vars
/usr/local/lib/python3.4/dist-packages/debug_toolbar/panels/sql/utils.py in reformat_sql
return swap_fields(''.join(stack.run(sql))) ...
▶ Local vars
/usr/local/lib/python3.4/dist-packages/sqlparse/engine/filter_stack.py in run
stream = filter_.process(stream)
It's absolutely because of sqlparse 0.2 api change.
Just got same error on Django==1.9.8
#852 #854 #855
I'm seeing this locally as well. Is there a workaround?
@iMerika just add 'sqlparse <0.2' to your dependencies (either requirements.txt
or setup.py
) explicitly to lock out incompatible version of this package.
I just merged a PR that fixes this.
@webknjaz just fixed this issue using your advise. Thanks! :)
@zhukandrey it's better you upgrade the toolbar's version to 1.5
instead. It's been released on pypi already: https://pypi.python.org/pypi/django-debug-toolbar
@webknjaz thank for the notice!
Thanks @aaugustin !
Upgrading to 1.5 worked for me. Thanks. 👍
Most helpful comment
@zhukandrey it's better you upgrade the toolbar's version to
1.5
instead. It's been released on pypi already: https://pypi.python.org/pypi/django-debug-toolbar