classification
Title: with Statement SyntaxError generated while following Tutorial
Type: compile error Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: astral451, georg.brandl
Priority: low Keywords:

Created on 2007-12-15 05:49 by astral451, last changed 2007-12-15 09:37 by georg.brandl. This issue is now closed.

Messages (2)
msg58659 - (view) Author: Nathan Turner (astral451) Date: 2007-12-15 05:49
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.
msg58660 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-12-15 09:37
Thanks, fixed in rev 59521.
History
Date User Action Args
2007-12-15 09:37:41georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg58660
2007-12-15 09:21:21christian.heimessetpriority: low
assignee: georg.brandl
nosy: + georg.brandl
2007-12-15 06:06:13astral451setseverity: normal -> minor
2007-12-15 05:51:07astral451settitle: with Statement Error generated following Tutorial -> with Statement SyntaxError generated while following Tutorial
2007-12-15 05:49:29astral451create