Invalid ioLocale
Hi,
I'm trying to use the SavReader function
import savReaderWriter as spss
savFileName = "my_file.sav"
raw_data = spss.SavReader(savFileName,returnHeader = True, ioUtf8=True)
but I systematically get this error message :
File "C:\Anaconda\lib\site-packages\savReaderWriter\generic.py", line 390, in ioLocale raise ValueError("Invalid ioLocale: %r" % localeName) ValueError: Invalid ioLocale: 'fr_FR.cp1252'
This error persists even if I add a specifical value to ioLocale argument in the SavReader function.
Thanks.
Best regards, Dom
Comments (9)
-
repo owner -
repo owner PS: what you could also try (in case you cannot easily update
savReaderWriter
) is toreader = spss.SavReader(savFileName, returnHeader=True, ioUtf8=True, ioLocale="french") raw_data = reader.all() reader.close()
-
Hi,
Thank you for your quick answers. I use Python 2.7.9 and the version 3.3.0 of savReaderWriter (it is the bleeding edge, isn't it ?)
Moreover, If I add
ioLocale="french"
then it produces a new error :
File "C:\Anaconda\lib\site-packages\savReaderWriter\error.py", line 118, in checkErrsWarns raise SPSSIOError(msg, retcode) SPSSIOError: Problem getting ReleaseInfo [SPSS_NO_TYPE73]
Best regards, Dom
-
repo owner Hi Dom,
The bleeding edge version may be installed by using
pip install -U -e git+https://bitbucket.org/fomcl/savreaderwriter.git#egg=savreaderwriter
, version 3.3.0 is getting quite old by now. Not sure what the type73 error is about. Is this a valid .sav file? If it is a non-confidential file I could have a look.Regards, Albert-Jan
-
My problem is I can't use this instruction
#! pip install -U -e git+https://bitbucket.org/fomcl/savreaderwriter.git#egg=savreaderwriter
because it produces this error
#! efrror: RPC failed; result=18, HTTP code = 200 atal: The remote end hung up unexpectedly fatal: early EOF
So I've used used this instruction
#! pip install savReaderWriter --allow-all-external
I thought it would install the last version... V3.3.0 is not the last version ? If it is not, How can I get the last version in another way than using the first mentionned
pip install -U -e git+https://bitbucket.org/fomcl/savreaderwriter.git#egg=savreaderwriter
instruction ?Unfortunatly I can't send you the sav file because it's a confidential file indeed, but I really don't think the problem come from the .sav file.
Thanks again
Best regards, Dom
-
repo owner Hi,
The long pip command installs the HEAD revision from master. I have never seen the error you see, but maybe this helps: https://confluence.atlassian.com/plugins/servlet/mobile#content/view/301663284
Alternatively, you can download the master branch here: https://bitbucket.org/fomcl/savreaderwriter/get/master.zip
Regards, Albert-Jan
-
repo owner Btw, in another issue somebody pointed out that the docs say that SPSS_NO_TYPE73 should be treated as a wsrning, although the retcode > 0. I fixed that in v3.4
-
repo owner At least in part duplicate of issue
#40, which is fixed now. Closing this issue now (finally!), but feel free to re-open it if you think this is not fixed. Locales are quite a thorny issue.Regards, Albert-Jan
-
repo owner - changed status to duplicate
Duplicate of
#40. - Log in to comment
Hi,
What version of the program are you using? There have been a number of locale-related issues. Better to use the bleeding edge version. I reported a bug in Python about this before (http://bugs.python.org/issue23425), which affects French, among other locales. In the most recent savReaderWriter version this is fixed (I hope!). See the readme on how to pip install the bleeding edge version.
regards, Albert-Jan