This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author oripel
Recipients
Date 2006-04-29.22:00:38
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 14:39:44adminlinkissue1479099 messages
2007-08-23 14:39:44admincreate