Bug when using with_statement with exec

Jerry Hill malaclypse2 at gmail.com
Tue Jul 15 00:32:33 CEST 2008


On Mon, Jul 14, 2008 at 6:00 PM, Matimus <mccredie at gmail.com> wrote:
> If I create a function by using exec on a string and _don't_ end the
> string with a new-line it will work just fine unless I "from
> __future__ import with_statement".
[snip]
> I searched python's issue database and didn't see anything similar to
> this. If there is already an issue related to this, please point me to
> it... or better yet, let me know how you found it.

Possibly related to http://bugs.python.org/issue1184112, and/or
http://bugs.python.org/issue501622?

Since you asked, I found it by googling the words "python exec with
newline".  The second item was an email on Python-Dev with a similar
bug and referencing an issue id.  The comments on that issue led to
the other one.

-- 
Jerry



More information about the Python-list mailing list