Incompatibility with Django 1.11.8 and later
See original GitHub issueDear valued Django-LdapDB developers,
we have observed an incompatibility between django-ldapdb and django 1.11.8 and later.
The problem is, that django introduced this commit https://github.com/django/django/commit/d97f026a7ab5212192426e45121f7a52751a2044#diff-4acea48b4435c36cdfd637839b45faf8
That changed the signature of the results_iter function in SQLCompiler.
Now, when we call makemigrations, we get the following error:
Traceback (most recent call last):
File "/home/a2822bp/.pycharm_helpers/pycharm/django_manage.py", line 43, in <module>
run_module(manage_file, None, '__main__', True)
File "/usr/lib/python3.5/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.5/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/a2822bp/projects/macbook/dssweb/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/core/management/commands/makemigrations.py", line 110, in handle
loader.check_consistent_history(connection)
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/db/migrations/loader.py", line 282, in check_consistent_history
applied = recorder.applied_migrations()
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/db/migrations/recorder.py", line 66, in applied_migrations
return set(tuple(x) for x in self.migration_qs.values_list("app", "name"))
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/db/models/query.py", line 250, in __iter__
self._fetch_all()
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/db/models/query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/home/a2822bp/.virtualenvs/dssweb/lib/python3.5/site-packages/django/db/models/query.py", line 122, in __iter__
for row in compiler.results_iter(chunked_fetch=self.chunked_fetch):
TypeError: results_iter() got an unexpected keyword argument 'chunked_fetch'
Process finished with exit code 1
This was also encountered by another user: https://stackoverflow.com/questions/47834769/typeerror-execute-sql-got-an-unexpected-keyword-argument-chunk-size
When I change the function signature of results_iter in /ldapdb/backends/ldap/compiler.py to accept the keyword chunked_fetch, everything seems to work fine again.
- def results_iter(self, results=None):
+ def results_iter(self, results=None, chunked_fetch=None):
Best Regards, Stephan Peinkofer
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hello @peinkofer ,
the master branch with Django 2.0 works now. I will close the issue. If you have still problems or new errors I am happy if you reopen this issue and we could fix it.
The module will soon be up to date on pypi.
Now
Django 1.11
should works with the branch0.9
. I will care soon about themaster
branch that it will works withDjango 2.0
.@peinkofer Is your problem solved?