I am trying to run a script on the arcgis server and we get the following error (attached a screenshot).:
line 40 SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0x97 in position 0: invalid start byte
When I run the script it doesn't give me any kind of error, it only gives us error when it is executed on the server.
Any idea how to solve it?
It sounds like the text of part of the script is unreadable. This has happened to me if I have copied some code from one source to another and the text encoding is different between the two. In my case, the double quote character from Microsoft Word was not compatible with Python IDLE. To avoid this, I copied the code to notepad, then copied that text to the Python editor. Another issue might be if the code is trying to read a file. What is the command on Line 40 in your script?
I've tried several times, I've rewritten the script from scratch, I've copied it to Notepad as well and it still doesn't work.
The script runs perfectly on local, it is uploaded to the server and does not give any error, but when I run it on the server, I still get this error.
It seems that when I run the script in arcgis it either adds some lines to the script or keeps saying that there is something it can't read.
elm.text = dates.last_threemonths + '—' + dates.current_month
Thanks for your help