I have a synthetic script running on App Dynamics which asserts that the title of the page contains the non-Ascii character 'EN DASH'. The script runs fine on App Dynamics, but when I copy the script locally Python attempts to decode the character using Ascii and throws the following error:
SyntaxError: Non-ASCII character '\xe2' in file my-script.py on line 24, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
I've tried forcing Python to use UTF-8 encoding by including the following at the top of the script:
# coding=utf-8
...but I then see the following error.
File "scripts/halo-privacy-center.py", line 25, in <module>
assert "Tesco – Privacy Centre" in driver.title
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6: ordinal not in range(128)
Where can I find information on how the environment for Python is configured for App Dynamics so I can replicate that locally? Or in other words, how can I force Python to decode characters in the same way it does in App Dynamics?
... View more