Bugs item #992207, was opened at 2004-07-16 11:21 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=992207&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parser/Compiler Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Konrad Hinsen (hinsen) Assigned to: Nobody/Anonymous (nobody) Summary: exec statement balks at CR/LF Initial Comment: Under Linux and MacOS (no others tested), if "foo.py" is a DOS/ Windows style Python file (CR/LF line endings), then python foo.py will work, as will execfile("foo.py") and exec file("foo.py") from inside Python. However, exec file("foo.py").read() will report a syntax error. In other words, the parser seems to accept CR/LF only if the source of the data is a file, not a string. When running under Linux and MacOS (no others tested), the exec statement reports a syntax error. I didn't find anything about this in the documentation, so I don't know if it's a bug or a feature. If it's a feature, it is not a useful one! ---------------------------------------------------------------------- >Comment By: Georg Brandl (birkenfeld) Date: 2006-01-10 23:57 Message: Logged In: YES user_id=1188172 I'm not sure this is a bug. Is exec supposed to accept code in crlf-terminated strings? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=992207&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com