Python complains about finding carriage returns when it expects newlines

If I try to run the example in .../Python/examples on my fedora machine I get the followinf error:

SyntaxError: (mismatched character \r expecting \n, (string, 7, 1, # change parameters depending on your pan tilt, pins and

at org.python.core.ParserFacade.fixParseError(    at org.python.core.ParserFacade.parse(    at org.python.core.Py.compile_flags(    at org.python.util.PythonInterpreter.exec(    at org.myrobotlab.service.Python$ Source)------

If I remove the carriage returns everything works fine. It seems the read routine in  python isn't converting dos text file to linux style correctly.


GroG's picture

Thanks for the

Thanks for the post...

  • where did you get the file ?  
  • how did you transfer it to your system ?
  • what kind of system are you on (guessing Linux of some flavor) ?
DRogge's picture

File is from the distribution

File is from the distribution at

Got a copy using svn.

Yep, fedora. I think it version 15.

Not exactly sure but I think I saw the same problem on Windows XP.

SpenMarsden's picture

I've been viewing the scripts

I've been viewing the scripts within IDLE and spotting odd characters. Not quite got a good way of purging them yet..