error at beginning of script ?

many times I get the error
error on line length ?
but not line number for the error ?

how come and how can I get rid of it ?

and when I get this it refuse to run the script
then I have to close and re open the file to run the script !

thanks

Sounds like you might have illegal characters cut and pasted from a web page in your script.

could be but not certain !

any way to detect where these are located in file

thanks

i noticed that some times you get better error messages by working directly in the text editor

using the same code

another prob I had once was character encoding
make sure you are working in an editor that only handles utf8
then it will be obvious in the editor itself

I don’t get that all the time
and if it was and UTF 8 I guess it would tell me that
but in this case it only tells me that the length of line are not good
and it does not give the line number

so difficult to find where it is ?

and the thing is that if I reload the file it will run ok !
so strange that it refuse when I upload from the text editor first time
and then refuse to run but then when I close and re open file then run
it is ok !

thanks

I had this sort of thing happen the other day it was a tab/space issue not matching.
I am new to python and didn’t understand the indenting rules so I broke that part heaps.
However if I ran the code from the script it would fail with the same type of error you are getting
I didn’t try realoading the file. I was calling it via
filename=“fullpath”
exec(compile(open(filename).read(), filename, ‘exec’))
In the blender text editor.
running this way sometimes (not always) gave me useless error messages
However cut and paste the same code from the my editor directly into the text area would return useful error messages (thus my first post).
I sounds like your caught up in an environment in an environment in an environment sought of problem.
I have had this sought of problem before and never really solved it just worked around it.

Sorry I couldn’t be more help but I hope this info helps a bit.

Just had a thought

Maybe it’s the end of lines characters
My editor adds unix LF only however I am working in OSX this is not really much of a problem these days
it used to be a nightmare.
however it could be causing obscure parsing errors