VSQL error: unsupported locale character encoding

OSX 10.10. Getting an error when running the vsql process from Python in both 7.X and 6.X client tools:
vsql: unsupported locale character encoding.   Use a utf8 locale, not a US-ASCII locale
Here's the command I'm running:
/opt/vertica/bin/vsql  -h ## -p ## -U ## -w # -d # -At -c "SELECT * FROM MY_SCHEMA.MY_TABLE"
This command works perfectly when executed from the Terminal, just fails with that error when ran via Python. It even fails when the command is simply to run the vsql executable with no params:
CMDstr = '/opt/vertica7/bin/vsql'  result,error = Popen(CMDstr, shell=True, stdout=PIPE,  stderr=PIPE).communicate()  print(error)   # yields above err  
Anyone seen this error before?

Comments

  • Solved by prefixing CMDstr to set LANG, i.e.
    CMDstr = 'export LANG=en_US.UTF-8 && /opt/vertica7/bin/vsql (...)'
  • Tried changing the locale settings.. but in-vain and encountering the below error

     

    $./vsql      
    Invalid locale: run the "locale" command and check for warnings
    $locale
    LANG=en_US.UTF-8
    LC_COLLATE="C"
    LC_CTYPE="C"
    LC_MONETARY="C"
    LC_NUMERIC="C"
    LC_TIME="C"
    LC_MESSAGES="C"
    LC_ALL=en_US.UTF-8
    $

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file