From: Chuck E. <ec...@mi...> - 2000-12-24 23:55:35
|
If you're on UNIX with Python 1.5.2, then: exec someString will fail with a syntax error, *if* someString contains CRLF endings (CRLF=\015\012). But at the command line, "python someFile.py" will work just fine. And I guess you just discovered a file object with exec will work as well. Perhaps that and the python command line use readline() which doesn't have the same CRLF problems as read()? I don't know; that's just speculation. I also don't know if Py 2.0 has this problem or not. In any case, if you do a "cvs update" you'll get my new code which simply removes the CRs. I tested on BSD with Py 1.5.2. Please try again and let me know if you have problems, -Chuck At 10:28 AM 12/24/2000 -0500, Dave wrote: >I don't understand why, but in install.py:readProperties() the exec fails >on the CGIWrapper Properties.py unless I alter the current CVS line: > ># does not work for me, fails with SyntaxError on the first line >exec open(filename).read() in results > >to this: ># works for me >exec open(filename) in results > >anyone else seen this? According to the docs there is some wierdness when >exec'ing strings that don't end with a newline, but that doesn't seem to >be the case here. > >Dave. > > >_______________________________________________ >Webware-discuss mailing list >Web...@li... >http://lists.sourceforge.net/mailman/listinfo/webware-discuss |