Issue 28713: Recent tutorial for recent Python3 still uses IOError. (original) (raw)

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.