open() and EOFError
marko at pacujo.net
Mon Jul 7 20:42:25 CEST 2014
Steven D'Aprano <steve+comp.lang.python at pearwood.info>:
> f = open(path)
> except Whatever:
> with f:
That's cool. Never really used try-else.
> That gets old really quickly! But then, handling errors is always the
> ugliest part of coding. Hiding the messy details inside a function is
> often a good idea.
There's no way around it; life is messy.
More information about the Python-list