[New-bugs-announce] [issue1634] with Statement Error generated following Tutorial

Nathan Turner report at bugs.python.org
Sat Dec 15 06:49:29 CET 2007

New submission from Nathan Turner:

In Python Tutorial -- Section 8.7 "Predefined Clean-up Action"
When following the "with open..." commands explicitly Python 2.5 will
generate a Syntax Error;
"There's an error in you program: invalid syntax"

It would be nice if a foot note existed that took you to Python
Reference Manual -- section 7.5 "The with statement"
In that section it explains that in Python 2.5 you need to use

from __future__ import with_statement

For new users this might frustrate.

components: Documentation
messages: 58659
nosy: astral451
severity: normal
status: open
title: with Statement Error generated following Tutorial
type: compile error
versions: Python 2.5

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list