Message28384
The 'compile' built-in function sometimes fails when
given a source string that doesn't end in an EOL.
The following example crashes Python 2.3, 2.4, and 2.5a1:
prompt> ./python2.5 -c "compile('def foo(x):\n
pass\n#abc', 'blah.py', 'exec')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "blah.py", line 3
#abc
^
SyntaxError: invalid syntax
Attached is a patch to Lib/test/test_compile.py with a
test for this. |
|
Date |
User |
Action |
Args |
2007-08-23 14:39:44 | admin | link | issue1479099 messages |
2007-08-23 14:39:44 | admin | create | |
|