-1

I have a django web application which has some celery tasks. One of the tasks launches a fabric script. When i a run the fabric script manually, the locale value is OK:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=pt_PT.UTF-8
LC_TIME=pt_PT.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_PT.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_PT.UTF-8
LC_NAME=pt_PT.UTF-8
LC_ADDRESS=pt_PT.UTF-8
LC_TELEPHONE=pt_PT.UTF-8
LC_MEASUREMENT=pt_PT.UTF-8
LC_IDENTIFICATION=pt_PT.UTF-8
LC_ALL=

When the fabric script is launched by the celery task, the locale is:

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Does anyone know how to fix this?

Running Ubuntu 12.04.4 LTS. Django and celery workers are running with supervisor.

Thanks

luistm
  • 1,027
  • 4
  • 18
  • 43

1 Answers1

0

Not sure what causes this problem, but i've manage to solve it using the solution described here: UnicodeEncodeError: 'ascii' codec can't encode character (check akaihola answer!), which recommends the addition of the environment variable to the supervisor.conf.

Thanks

Community
  • 1
  • 1
luistm
  • 1,027
  • 4
  • 18
  • 43