Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
os: add function to expand "~" to home directory (#11362)
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bd33eaa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more since to make
os.real_path
do this. Maybe make the function you have there private and call it immediately insideos.real_path
? That is, if it doesn’t already do checks for tildebd33eaa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see an additional benefit in adding it to real_path. But I don't think it should be private since it's not always desired to get the real path. If you're working with symlinks it's not always desired to resolve them but you want the tilde expanded