[Pythonmac-SIG] \r in string causes eval to fail

Chris Barker Chris.Barker at noaa.gov
Wed Sep 15 22:42:03 CEST 2004

Michael Hudson wrote:
> "Chris Barker" <Chris.Barker at noaa.gov> writes:
>>Michael Hudson wrote:
>>>Semi-seriously, I'd guess that everyone who's bumped into this has
>>>found it easier to normalize the line feeds in Python than hack the
>>>parser (it's a little scary).
>>Would you need to hack the parser? I'd be inclined to simply put a
>>filter in before the parser, just like I'd do in user code:
>>CodeString = FixLineFeeds(CodeString)
> Did you read what I said?

yes, but I didn't write what I meant, at least not clearly.

What I was trying to say was that rather than hack the parser, one could 
just insert a line feed fixer _before_ the parser, INSIDE eval and 
friends, essentially moving the python code I wrote, into eval. I can't 
imagine this would be hard, but it wouldn't get you any performance 
benefits over just writing one extra line of python.


Christopher Barker, Ph.D.
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the Pythonmac-SIG mailing list