mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 20:35:13 +00:00
util.standardize_path: properly handle "~" (user's home directory)
notably this is needed when the shell itself does not get a chance to expand "~", e.g. when a path is passed via JSON-RPC >>> os.path.normcase(os.path.realpath(os.path.abspath("~/.electrum/testnet/wallets/delete_me2"))) '/home/user/wspace/electrum/~/.electrum/testnet/wallets/delete_me2' >>> os.path.normcase(os.path.realpath(os.path.abspath(os.path.expanduser("~/.electrum/testnet/wallets/delete_me2")))) '/home/user/.electrum/testnet/wallets/delete_me2'
This commit is contained in:
parent
3716594331
commit
2ca535225d
1 changed files with 6 additions and 1 deletions
|
@ -458,7 +458,12 @@ def assert_file_in_datadir_available(path, config_path):
|
|||
|
||||
|
||||
def standardize_path(path):
|
||||
return os.path.normcase(os.path.realpath(os.path.abspath(path)))
|
||||
return os.path.normcase(
|
||||
os.path.realpath(
|
||||
os.path.abspath(
|
||||
os.path.expanduser(
|
||||
path
|
||||
))))
|
||||
|
||||
|
||||
def get_new_wallet_name(wallet_folder: str) -> str:
|
||||
|
|
Loading…
Add table
Reference in a new issue