def children(self):
        """
        List the children of this path object.

        @raise OSError: If an error occurs while listing the directory.  If the
        error is 'serious', meaning that the operation failed due to an access
        violation, exhaustion of some kind of resource (file descriptors or
        memory), OSError or a platform-specific variant will be raised.

        @raise UnlistableError: If the inability to list the directory is due
        to this path not existing or not being a directory, the more specific
        OSError subclass L{UnlistableError} is raised instead.

        @return: an iterable of all currently-existing children of this object.
        """
        try:
            subnames = self.listdir()
        except WindowsError as winErrObj:
            # Under Python 3.3 and higher on Windows, WindowsError is an
            # alias for OSError.  OSError has a winerror attribute and an
            # errno attribute.

            # Under Python 2, WindowsError is an OSError subclass.

            # Under Python 2.5 and higher on Windows, WindowsError has a
            # winerror attribute and an errno attribute.

            # The winerror attribute is bound to the Windows error code while
            # the errno attribute is bound to a translation of that code to a
            # perhaps equivalent POSIX error number.
            #
            # For further details, refer to:
            # https://docs.python.org/3/library/exceptions.html#OSError

            # If not for this clause OSError would be handling all of these
            # errors on Windows.  The errno attribute contains a POSIX error
            # code while the winerror attribute contains a Windows error code.
            # Windows error codes aren't the same as POSIX error codes,
            # so we need to handle them differently.

            # Under Python 2.4 on Windows, WindowsError only has an errno
            # attribute.  It is bound to the Windows error code.

            # For simplicity of code and to keep the number of paths through
            # this suite minimal, we grab the Windows error code under either
            # version.

            # Furthermore, attempting to use os.listdir on a non-existent path
            # in Python 2.4 will result in a Windows error code of
            # ERROR_PATH_NOT_FOUND.  However, in Python 2.5,
            # ERROR_FILE_NOT_FOUND results instead. -exarkun
            winerror = getattr(winErrObj, 'winerror', winErrObj.errno)
            if winerror not in (ERROR_PATH_NOT_FOUND,
                                ERROR_FILE_NOT_FOUND,
                                ERROR_INVALID_NAME,
                                ERROR_DIRECTORY):
                raise
            raise _WindowsUnlistableError(winErrObj)
        except OSError as ose:
            if ose.errno not in (errno.ENOENT, errno.ENOTDIR):
                # Other possible errors here, according to linux manpages:
                # EACCES, EMIFLE, ENFILE, ENOMEM.  None of these seem like the
                # sort of thing which should be handled normally. -glyph
                raise
            raise UnlistableError(ose)
        return [self.child(name) for name in subnames]

        List the children of this path object.

        @raise OSError: If an error occurs while listing the directory.  If the
        error is 'serious', meaning that the operation failed due to an access
        violation, exhaustion of some kind of resource (file descriptors or
        memory), OSError or a platform-specific variant will be raised.

        @raise UnlistableError: If the inability to list the directory is due
        to this path not existing or not being a directory, the more specific
        OSError subclass L{UnlistableError} is raised instead.

        @return: an iterable of all currently-existing children of this object.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/filepath.py