locale error when running on Ubuntu

Issue #65 new
Shlomi Lanton created an issue

I have a process for creating an SPSS file. It runs with no errors on my local machine and also on my production server. When I try to run it using celery (version 3.1.23) on my production server in SOME cases I get this error message:

unsupported locale setting

The most strange thing is that I don't get this error on every time that I run my process, but only on some occasions and I can't figure out what is the common ground for all cases when I get this error.

I'm using Python 2.7 in all machine and my production server is running on Ubuntu 14.04.

Comments (2)

  1. Albert-Jan Roskam repo owner

    Hi,

    What is the output of locale in the shell? I get:

    albertjan@debian:~/nfs/Public/savReaderWriter/savReaderWriter$ locale 
    LANG=en_US.UTF-8
    LANGUAGE=
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    

    savReaderWriter tries to initialize the SPSS I/O locale by copying the host locale. Maybe your machine is set to a C locale? You could also set the explicitly specify the ioLocale in savWriter:

    with SavWriter(savFileName, varNames, varTypes, ioLocale='en_US.UTF-8') as writer:
        pass
    

    This will work, I think, provided that your system has the locale 'en_US.UTF-8' installed.

    Locales are a thorny issue! Do you have any idea why this only occurs in SOME cases?

    Best wishes, Albert-Jan

  2. Log in to comment