New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 31798: invalid continuation byte #168
Comments
@mgdondon great bug writeup! I am able to run this and I've posted my results to the new saspy-examples/Issues folder I'm running 9.4m5, and am, of course, on a 64 bit OS. I should be able to try out 9.4m1, but I don't think I'll be able to run anything on 32bits. I'm a little suspicions of that. I'm curious why the workpath didn't get resolved right, but I should see that in the log. There are 2 things I'd like you to do, if you would. The first is to
so we can see if there was any kind of error or anything strange on the SAS side for this. I have that in my run (https://github.com/sassoftware/saspy-examples/blob/master/Issue_examples/Issue168.ipynb). The other thing is to try the sasioiom.py that's at master. I had some strange errors like this with translated version of SAS in Chinese which I also can't reproduce here, that I've been trying to track down. That file at master had a little different path for that lstf.decode(), so I think that will get a result, which may show us what we're getting in that lst that is throwing the error. Can you run this with the saslog output, with your existing 2.2.7, then again w/ master? Thanks! |
One other thought. The saspyiom.jar file changed in 2.2.7, from 2.2.6. Can you make sure that the classpath when running 2.2.7 is pointing to the new jar? Just to be sure :) |
SAS log with SASPy 2.2.7Import in Python import pandas as pd
data_url = "https://forge.scilab.org/index.php/p/rdataset/source/file/master/csv/datasets/cars.csv"
df_python = pd.read_csv(data_url)
df_python.drop(df_python.columns[[0]], axis=1, inplace=True) Summary in SAS import saspy
session_sas = saspy.SASsession(cfgname='winlocal')
session_sas
df_sas = session_sas.df2sd(df_python) print(session_sas.saslog())
df_sas.describe()
print(session_sas.saslog())
|
Ah, this is also a translated version of SAS! That's why the WORK Path isn't getting found. And, no LOG for the proc means, as that would have been done after the error, so it's not in there. |
It's all right with sasioiom.py that's at master and SASKernel is also OK. Thank you very much, SAS log with SASPy 2.2.7 and sasioiom.py at masterImport in Python import pandas as pd
data_url = "https://forge.scilab.org/index.php/p/rdataset/source/file/master/csv/datasets/cars.csv"
df_python = pd.read_csv(data_url)
df_python.drop(df_python.columns[[0]], axis=1, inplace=True) Summary in SAS import saspy
session_sas = saspy.SASsession(cfgname='winlocal')
session_sas
df_sas = session_sas.df2sd(df_python) print(session_sas.saslog())
df_sas.describe()
print(session_sas.saslog())
|
I think I figured it out! It is the translated ODS in the earlier SAS releases. They’re different then current releases. Sweet. You’re done and should be fixed! No need to do any more testing for me. Thanks for helping me track this down! |
Thank you for the explanation. |
No problem. Kinda for everyone who might run into this too. It appears it was 9.4M3 that changed to be utf-8 all the time. Previous versions are session encoding. I'll close this issue, but link it to the others where I've seen this same problem. Thanks! |
FYI: |
Is the utf-8 decode bug fixed in the current version? |
@jurandi82 yes, this was fixed 3 years ago. Will you open a new issue with your information: what versions of saspy/SAS, the code you're submitting and the output it gets (all of it), your configuration info, and anything else you think would be relevant? |
Saspy still ignore other encoding in config, I use pandas to read latin1 and upload as utf-8 and works for me. |
Hello,
It seems to be a bug in version 2.2.7
Import in Python
Summary in SAS
session_sas
which is not in version 2.2.6
session_sas
Two more remarks:
session_sas
Thanks,
The text was updated successfully, but these errors were encountered: