Skip to content Skip to sidebar Skip to footer

Fabric, Can't Get Default Locale On Django

I have the following django management command: fabrictest.py from django.core.management.base import NoArgsCommand import locale class Command(NoArgsCommand): def handle_noa

Solution 1:

Looking at this question it seems like those are picked up environment variables.

You could export them manually, either in the run() or with a prefix() context manager. You may also try setting pty to False in the run().

Solution 2:

From the docs:

According to POSIX, a program which has not called setlocale(LC_ALL, "") runs using the portable 'C' locale. Calling setlocale(LC_ALL, "") lets it use the default locale as defined by the LANG variable. Since we don't want to interfere with the current locale setting we thus emulate the behavior in the way described above...

...code and encoding can be None in case the values cannot be determined.

If you program can't run using the 'C' locale then call setlocale() and/or set appropriate environment variables e.g., LANG.

Post a Comment for "Fabric, Can't Get Default Locale On Django"