Call :meth:`Path.open` on this path (passing *kwargs*) and return the
        result. If the file doesn't exist, the behavior depends on
        *null_if_noexist*. If it is false (the default), ``None`` is returned.
        Otherwise, :data:`os.devnull` is opened and returned.

def try_open (self, null_if_noexist=False, **kwargs):
        """Call :meth:`Path.open` on this path (passing *kwargs*) and return the
        result. If the file doesn't exist, the behavior depends on
        *null_if_noexist*. If it is false (the default), ``None`` is returned.
        Otherwise, :data:`os.devnull` is opened and returned.

        """
        try:
            return self.open (**kwargs)
        except IOError as e:
            if e.errno == 2:
                if null_if_noexist:
                    import io, os
                    return io.open (os.devnull, **kwargs)
                return None
            raise