Issue992207
Created on 2004-07-16 09:21 by hinsen, last changed 2009-03-31 16:57 by georg.brandl.
|
msg60529 - (view) |
Author: Konrad Hinsen (hinsen) |
Date: 2004-07-16 09:21 |
|
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!
|
|
msg60530 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2006-01-10 22:57 |
|
Logged In: YES
user_id=1188172
I'm not sure this is a bug.
Is exec supposed to accept code in crlf-terminated strings?
|
|
msg82036 - (view) |
Author: Daniel Diniz (ajaksu2) |
Date: 2009-02-14 12:42 |
|
The behavior is still present, but I'm not sure it's a bug either. The
documentation could mention this:
http://docs.python.org/dev/reference/simple_stmts.html#exec
|
|
msg84837 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2009-03-31 16:57 |
|
Documented in r70838, r70840.
|
|
| Date |
User |
Action |
Args |
| 2009-03-31 16:57:30 | georg.brandl | set | status: open -> closed resolution: fixed messages:
+ msg84837
|
| 2009-02-14 12:42:51 | ajaksu2 | set | versions:
+ Python 2.7, - Python 2.3 nosy:
+ georg.brandl, ajaksu2 messages:
+ msg82036 assignee: georg.brandl components:
+ Documentation keywords:
+ easy type: feature request stage: test needed |
| 2004-07-16 09:21:42 | hinsen | create | |
|