[docs] [issue28713] Recent tutorial for recent Python3 still uses IOError.

Daisuke Miyakawa report at bugs.python.org
Wed Nov 16 02:37:22 EST 2016


New submission from Daisuke Miyakawa:

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.

----------
assignee: docs at python
components: Documentation
messages: 280924
nosy: dmiyakawa, docs at python
priority: normal
severity: normal
status: open
title: Recent tutorial for recent Python3 still uses IOError.
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28713>
_______________________________________


More information about the docs mailing list