New submission from Mathieu Bridon: I found myself writing the following code the other day:
try: os.mkdir(path) except PermissionError: do_something() except FileExistsError: do_something_else() except FileNotFoundError: do_yet_another_thing() except OSError as e: import errno if e.errno == errno.ENOSPC: and_do_one_more_different_thing() else: raise e The OSError subclasses in Python 3 are amazing, I love them. I just wish there'd be more of them. :) ---------- components: Library (Lib) messages: 229729 nosy: bochecha priority: normal severity: normal status: open title: An OSError subclass for "no space left on device" would be nice versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22678> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com