Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can only concatenate list (not "tuple") to list #573

Closed
Novarg opened this issue Jun 17, 2019 · 8 comments
Closed

TypeError: can only concatenate list (not "tuple") to list #573

Novarg opened this issue Jun 17, 2019 · 8 comments

Comments

@Novarg
Copy link

Novarg commented Jun 17, 2019

There is an error when start celery workers through manage.py command.

celery 3.1.25
django 1.11.2

(mr) vlad-mbp:mr novarg$ ./manage.py celery worker -P gevent -l DEBUG -Q default,celery,ldapsync_tasks,email_release_tasks
master

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 205, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/djcelery/management/commands/celery.py", line 11, in <module>
    class Command(CeleryCommand):
  File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/djcelery/management/commands/celery.py", line 23, in Command
    preload_options)
TypeError: can only concatenate list (not "tuple") to list

It seems that base.preload_options is tuple while others are lists.

@stuaxo
Copy link

stuaxo commented Jun 17, 2019

Confirming.

Installing 3.2.2 works as a workaround.

@stuaxo
Copy link

stuaxo commented Jun 17, 2019

You can trigger it with most options, e.g. python manage.py celery list bindings.

@maxmalysh
Copy link

maxmalysh commented Jun 17, 2019

Python 3.7.3
django==1.11.21
celery==3.1.26.post2
django-celery==3.3.0

python3 manage.py celery --help

Traceback (most recent call last):
  File "manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 206, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/djcelery/management/commands/celery.py", line 11, in <module>
    class Command(CeleryCommand):
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/djcelery/management/commands/celery.py", line 23, in Command
    preload_options)
TypeError: can only concatenate list (not "tuple") to list

3.2.2 works fine.

@jttttttttttttt
Copy link

Python 3.6.8
django==2.1.10
celery==3.1.26.post2
django-celery==3.3.0

TypeError: can only concatenate list (not "tuple") to list

django-celery 3.2.2 works fine.

frost-nzcr4 added a commit to frost-nzcr4/django-celery that referenced this issue Jul 11, 2019
@auvipy auvipy closed this as completed in 37d11da Jul 11, 2019
@stuaxo
Copy link

stuaxo commented Jul 11, 2019

Thank you!

Nice elegant solution :)

@frost-nzcr4
Copy link
Contributor

That fix also closes #560 and #575

@lhypj
Copy link

lhypj commented Jan 6, 2020

Python 3.7.3
django==1.11.21
celery==3.1.26.post2
django-celery==3.3.0

python3 manage.py celery --help

Traceback (most recent call last):
  File "manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 206, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/djcelery/management/commands/celery.py", line 11, in <module>
    class Command(CeleryCommand):
  File "/Users/mmalysh/Development/mining-website/venv/lib/python3.7/site-packages/djcelery/management/commands/celery.py", line 23, in Command
    preload_options)
TypeError: can only concatenate list (not "tuple") to list

3.2.2 works fine.

python3.7 cannot run with celery?

@frost-nzcr4
Copy link
Contributor

@SUNNYWILLHAPPEN this error not about Python version, you're need django-celery==3.3.1 at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants