UnicodeDecodeError: 'ascii' codec can't decode byte 0x96 in position 0
celery, django, python, python-unicode
Solution
That's tricky issue. The problem is in how you typed your command:
Wrong:
celery –A runLogProject worker –loglevel=INFO
Correct:
celery -A runLogProject worker -loglevel=INFO
It's almost impossible to spot a difference. In first to pass parameters -A and -loglevel are used dashes (ascii code: 8211) but should by hyphens (ascii code 45).
If you are using OSX, it could be triggered because you pressed ALT together with hyphen/minus key or you just copy pasted it from some blog which uses weird autocorrect.
Problem
I looked at a number of the answers to similar questions, but can't seem to see where the error is occurring in my code. The error occurs when I try to run celery: `celery –A runLogProject worker –loglevel=INFO`. I commented out all the code related to Celery and it gives the same error. I also tried reinstalling Celery. I'm not sure what else to try. Here is the traceback: ``` C:\Python27\lib\site-packages\celery\bin\celery.py:803: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if len(argv) > 1 and 'worker' in argv[0:3]: C:\Python27\lib\site-packages\celery\bin\celery.py:765: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if 'multi' in argv[1:3]: # Issue 1008 C:\Python27\lib\site-packages\celery\bin\base.py:398: UnicodeWarning: Unicode equal comparison failed to convert both ar guments to Unicode - interpreting them as being unequal if '--version' in argv: Traceback (most recent call last): File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "C:\Python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Python27\Scripts\celery.exe\__main__.py", line 9, in <module> File "C:\Python27\lib\site-packages\celery\__main__.py", line 30, in main main() File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 81, in main cmd.execute_from_commandline(argv) File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 769, in execute_from_commandline super(CeleryCommand, self).execute_from_commandline(argv))) File "C:\Python27\lib\site-packages\celery\bin\base.py", line 304, in execute_from_commandline argv = self.setup_app_from_commandline(argv) File "C:\Python27\lib\site-packages\celery\bin\base.py", line 435, in setup_app_from_commandline preload_options = self.parse_preload_options(argv) File "C:\Python27\lib\site-packages\celery\bin\base.py", line 500, in parse_preload_options return self.preparse_options(args, self.preload_options) File "C:\Python27\lib\site-packages\celery\bin\base.py", line 512, in preparse_options if arg.startswith('--'): UnicodeDecodeError: 'ascii' codec can't decode byte 0x96 in position 0: ordinal not in range(128) ```