Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with Statement SyntaxError generated while following Tutorial #45975

Closed
astral451 mannequin opened this issue Dec 15, 2007 · 2 comments
Closed

with Statement SyntaxError generated while following Tutorial #45975

astral451 mannequin opened this issue Dec 15, 2007 · 2 comments
Assignees
Labels
build The build process and cross-build docs Documentation in the Doc dir

Comments

@astral451
Copy link
Mannequin

astral451 mannequin commented Dec 15, 2007

BPO 1634
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2007-12-15.09:37:41.997>
created_at = <Date 2007-12-15.05:49:29.209>
labels = ['build', 'docs']
title = 'with Statement SyntaxError generated while following Tutorial'
updated_at = <Date 2007-12-15.09:37:41.974>
user = 'https://bugs.python.org/astral451'

bugs.python.org fields:

activity = <Date 2007-12-15.09:37:41.974>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2007-12-15.09:37:41.997>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2007-12-15.05:49:29.209>
creator = 'astral451'
dependencies = []
files = []
hgrepos = []
issue_num = 1634
keywords = []
message_count = 2.0
messages = ['58659', '58660']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'astral451']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue1634'
versions = ['Python 2.5']

@astral451
Copy link
Mannequin Author

astral451 mannequin commented Dec 15, 2007

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.

@astral451 astral451 mannequin added docs Documentation in the Doc dir build The build process and cross-build labels Dec 15, 2007
@astral451 astral451 mannequin changed the title with Statement Error generated following Tutorial with Statement SyntaxError generated while following Tutorial Dec 15, 2007
@birkenfeld
Copy link
Member

Thanks, fixed in rev 59521.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant