It appeared to be an encoding problem while opening the file, the following lines now give the correct output:
with open("script.py", encoding = 'utf-8') as file: exec(file.read())
Thanks everyone.