basically do os.path.expandvars in expand()