I am trying to run some cronjobs in django.
I have three of them, 2 of them are running flawlessly. but the third one is giving me the error:
../../monthly_abo_live.py", line 1
SyntaxError: encoding problem: with BOM
1. # -*- coding: utf-8 -*-
2. from django.core.management.base import BaseCommand, CommandError
According to this page:
you have two options...
To define a source code encoding, a magic comment must be placed into the source files either as first or second line in the file, such as: # coding=<encoding name> or (using formats recognized by popular editors) #!/usr/bin/python # -*- coding: <encoding name> -*-
(Note: While the above is a direct quote, @tdelaney pointed out - and I agree - that instead of the fixed path
#!/usr/bin/python one should use
It looks like you're using part of the second option but did not include the required first line (
#!/usr/bin/python ). Try inserting that before your "coding" line and see what happens.