def expand_path_vars(path: str) -> str:
    'Expand the environment or ~ variables in a path string.'
    path = str(path).strip()
    path = os.path.expanduser(path)
    path = os.path.expandvars(path)
    return path
Expand the environment or ~ variables in a path string.
def expand_path_vars(path: str) -> str:
    
    path = str(path).strip()
    path = os.path.expanduser(path)
    path = os.path.expandvars(path)
    return path