Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Celery logging handler fails to install with Python 2 #288

zsiciarz opened this Issue · 3 comments

3 participants


The recent Py3-related changes seem to break Celery error logging in Django. After I upgraded to raven==3.3.1, I get the following error on startup:

Failed installing logging handler for Celery
Traceback (most recent call last):
  File "/home/zbigniewsiciarz/v/gpanel/local/lib/python2.7/site-packages/raven/contrib/django/", line 194, in register_handlers
  File "/home/zbigniewsiciarz/v/gpanel/local/lib/python2.7/site-packages/raven/contrib/celery/", line 58, in register_logger_signal
    handler = SentryHandler(client)
  File "/home/zbigniewsiciarz/v/gpanel/local/lib/python2.7/site-packages/raven/handlers/", line 37, in __init__
  File "/home/zbigniewsiciarz/v/gpanel/local/lib/python2.7/site-packages/raven/contrib/django/", line 49, in <lambda>
    __repr__ = lambda x: repr(get_client())
  File "/home/zbigniewsiciarz/v/gpanel/local/lib/python2.7/site-packages/raven/contrib/django/", line 141, in get_client
    instance = getattr(__import__(module, {}, {}, class_name), class_name)(**options)
TypeError: Item in ``from list'' not a string

My guess is that __import__ expects class_name to be str, not unicode (thanks to unicode_literals import). This happens with Python 2.7.3 on Ubuntu 12.04, Django 1.4.5. Downgrading raven to 3.2.1 fixes the problem.


I see this too. I have a clean install of Django 1.4.5 and raven 3.3.1 (I see the problem in 3.3.0, too) in Python 2.7.3


Hi, this should have be fixed with the #287 (sorry, the PR title wasn't for that initially).


Raven 3.3.2 fixes this issue.

@xordoquy xordoquy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.