[New-bugs-announce] [issue10204] exec string fails with trailing whitespace

Eric Promislow report at bugs.python.org
Tue Oct 26 21:21:18 CEST 2010

New submission from Eric Promislow <ericp at activestate.com>:

The following code throws an exception in Python 3.1 (and 3.2 alpha),
but runs with 2.x:

>>> exec('if True:\n    print("Hello")\n    \n    ')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 4

SyntaxError: invalid syntax

This is with Python, but I can repro it with a 3.2 alpha
as well.

Ref Komodo bug http://bugs.activestate.com/show_bug.cgi?id=88566

components: Interpreter Core
messages: 119640
nosy: ericp
priority: normal
severity: normal
status: open
title: exec string fails with trailing whitespace
versions: Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list