[issue6220] typo: opne in "doanddont"

2009-06-06 Thread Ezio Melotti
Ezio Melotti added the comment: If we use the bare "except:" the message "could not open file!" is shown and we would waste time trying to figure out why it can't be opened. Instead, if we use "except IOError:", the first time we run the program the error "NameError: name 'opne' is not defined"

[issue6220] typo: opne in "doanddont"

2009-06-06 Thread John Szakmeister
John Szakmeister added the comment: Actually, what's the second example trying to show: try: foo = opne("file") # will be changed to "open" as soon as we run it except IOError: sys.exit("could not open file") I'm not sure what that comment really means? -- __

[issue6220] typo: opne in "doanddont"

2009-06-06 Thread John Szakmeister
John Szakmeister added the comment: That'll teach me to pay more attention before submitting a patch. Thanks Ezio! -- ___ Python tracker ___

[issue6220] typo: opne in "doanddont"

2009-06-06 Thread Ezio Melotti
Changes by Ezio Melotti : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue6220] typo: opne in "doanddont"

2009-06-06 Thread Ezio Melotti
Ezio Melotti added the comment: That "typo" is intentional, it's also written in the comment: try: foo = opne("file") # misspelled "open" except: sys.exit("could not open file!") This example shows how a bare except will catch the NameError caused by 'opne' and return the wrong error me

[issue6220] typo: opne in "doanddont"

2009-06-06 Thread John Szakmeister
John Szakmeister added the comment: Here's a patch for trunk. -- keywords: +patch nosy: +jszakmeister Added file: http://bugs.python.org/file14203/issue-6220-doanddont.patch ___ Python tracker _

[issue6220] typo: opne in "doanddont"

2009-06-06 Thread cate
New submission from cate : http://docs.python.org/dev/howto/doanddont.html use twice in example the "opne" function, which should be written as "open". From google it seems that also 3.x is affected (but not really checked) -- assignee: georg.brandl components: Documentation messages: 88