import inspect


def get_abs_path(depth=1):
    """
    Get the absolute path of the specified entry in the stack

    :param int depth: How far down the stack to look. Defaults to 1
    :return: Absolute path or None if any error
    :rtype: str
    """
    # Always start in a known place
    frames = inspect.stack()
    try:
        if 0 < depth <= len(frames):
            frame = frames[depth - 1]
            abs_path = frame.filename
        else:
            abs_path = None
    finally:
        for frame in frames:
            del frame

    return abs_path