MahmoudAbdelRahman / GH_CPython

CPython plugin for Rhino-Grasshopper
BSD 2-Clause "Simplified" License
175 stars 38 forks source link

Problem no encoding declared #31

Open arch-tu opened 6 years ago

arch-tu commented 6 years ago

Hello! when i restart the grasshopper,it always has the problem: File "C:\GH_CPython\PythonFileWritten_1.py", line 1 SyntaxError: Non-ASCII character '\xe2' in file C:\GH_CPython\PythonFileWritten_1.py on line 1, but no encoding declared However,# -- coding: utf-8 -- has been in line1 Thanks!

hat600 commented 5 years ago

i have the same bug.

it is in THAT .py, not your python code. the coding declaration in THAT .py is in line 2, and this makes problem

miraclema999 commented 4 years ago

I have the same bug and after I restart rhino and gh, it disappear. With poor python experience, I can't figure out why, in the folder there isn't any aforementioned 'PythonFileWritten_1.py'. @hat600 have you got some solution?

hat600 commented 4 years ago

I have the same bug and after I restart rhino and gh, it disappear. With poor python experience, I can't figure out why, in the folder there isn't any aforementioned 'PythonFileWritten_1.py'. @hat600 have you got some solution?

it seems that python 3 do not have this problem.

miraclema999 commented 4 years ago

I have the same bug and after I restart rhino and gh, it disappear. With poor python experience, I can't figure out why, in the folder there isn't any aforementioned 'PythonFileWritten_1.py'. @hat600 have you got some solution?

it seems that python 3 do not have this problem.

I think I find why. The .gh file is in a folder that has Non-ASCII character, so in the *\PythonFileWritten_1.py there is a line containing this folder name. When I put the .gh file to another folder, it fixed. This issue does not happen every time, I don't know why. Hopefully can help others.