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@python
components: Documentation
messages: 280924
nosy: dmiyakawa, docs@python
priority: normal
severity: normal
status: open
title: Recent tutorial for recent Python3 still uses IOError.
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28713>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to