Load python script Error: Utf-8 codec cant decode bytr 0xba in position 1

Hi guys

I have a problem running a python script, i test it outside Uipath and it works but when i use it with the load python script activities it throws this exception
python%20codec

I have setup the python scope correctly and as i said the Script runs when executed from an IDE or command prompt
Here is the scriptThings.zip (2.1 KB)

@brandon_araya

That is because you need to replace a single quotes with double quotes or need to pass one more back slash in the code. Just try to do that in the particular line which is there in the error

1 Like

Hi, i have found the character that causing the problem in the script, is this: β€œNΒΊ doc.” the python activity cant decode it and thus braking the execution. so i’m going to filter the unicode characters from the column names of the data frame and and clean the code

1 Like

Yeah,

Please let me know if it works @brandon_araya

I fixed it by using openpyxl to change the value of the first cell to a name without the character like this.

for cell in target[β€œA”]:
if type(cell.value) is str:
if β€˜doc’ in cell.value:
target[cell.coordinate]= β€˜N doc.’

and then i erase the character from the script

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.