question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with Django 1.11.8 and later

See original GitHub issue

Dear 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ikreb7commented, Feb 6, 2018

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.

0reactions
ikreb7commented, Jan 29, 2018

Now Django 1.11 should works with the branch 0.9. I will care soon about the master branch that it will works with Django 2.0.

@peinkofer Is your problem solved?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django 1.11 release notes
Welcome to Django 1.11! These release notes cover the new features, as well as some backwards incompatible changes you'll want to be aware...
Read more >
Release notes - Django documentation
Release notes for the official Django releases. Each release note will tell you what's new in each version, and will also describe any...
Read more >
FAQ: Installation | Django documentation
Django runs SQLite by default, which is included in Python installations. For a production environment, we recommend PostgreSQL; but we also officially support ......
Read more >
Django 3.0 release notes
These release notes cover the new features, as well as some backwards incompatible changes you'll want to be aware of when upgrading from ......
Read more >
Django 1.11.8 release notes
Made QuerySet.iterator() use server-side cursors on PostgreSQL after values() and values_list() (#28817). Fixed crash on SQLite and MySQL ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found