[Python-Dev] Bug 1184112 still valid

Fredrik Lundh fredrik at pythonware.com
Fri Mar 17 15:56:48 CET 2006

Wolfgang Langner wrote:

> today I got my first real python bug. Problem is described in:
> Bug with ID: 1184112
> http://sourceforge.net/tracker/index.php?func=detail&aid=1184112&group_id=5470&atid=105470
> I use python 2.3.5 in an embedded C++ Application which uses function:
> PyRun_SimpleString.

the "missing trailing newline may cause errors for multiline statements" is
documented behaviour; from the compile() docs:

    "When compiling multi-line statements, two caveats apply: line
    endings must be represented by a single newline character ('\n'),
    and the input must be terminated by at least one newline character."

see the codeop.py sources for library code that depends on this behaviour.


More information about the Python-Dev mailing list