This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Recent tutorial for recent Python3 still uses IOError.
Type: Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: dmiyakawa, docs@python, kushal.das, python-dev
Priority: normal Keywords: patch

Created on 2016-11-16 07:37 by dmiyakawa, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue28713.patch kushal.das, 2016-11-16 15:22 Patch for tutorial review
Messages (3)
msg280924 - (view) Author: Daisuke Miyakawa (dmiyakawa) * Date: 2016-11-16 07:37
https://docs.python.org/3.5/tutorial/errors.html


for arg in sys.argv[1:]:
    try:
        f = open(arg, 'r')
    except IOError:
        print('cannot open', arg)
    else:
        print(arg, 'has', len(f.readlines()), 'lines')
        f.close()


Although IOError is still available as an alias to OSError, it should not be used in the tutorial, I believe.
msg280962 - (view) Author: Kushal Das (kushal.das) * (Python committer) Date: 2016-11-16 15:22
This following one line change should fix this one.
msg280963 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-16 15:49
New changeset 3375c111d1ff by Kushal Das in branch '3.6':
Closes #28713 uses OSError in the tutorial
https://hg.python.org/cpython/rev/3375c111d1ff

New changeset 15e5e476e4a1 by Kushal Das in branch 'default':
Closes #28713 uses OSError in the tutorial
https://hg.python.org/cpython/rev/15e5e476e4a1
History
Date User Action Args
2022-04-11 14:58:39adminsetgithub: 72899
2016-11-16 15:49:33python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg280963

resolution: fixed
stage: resolved
2016-11-16 15:22:23kushal.dassetfiles: + issue28713.patch

nosy: + kushal.das
messages: + msg280962

keywords: + patch
2016-11-16 07:43:24dmiyakawasetversions: + Python 3.6
2016-11-16 07:37:22dmiyakawacreate