Skip to content

Commit 1cc1911

Browse files
authored
Expand security file path (#298)
2 parents b413839 + 11760c0 commit 1cc1911

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ads/common/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,12 @@ def _read_security_token_file(self, security_token_file: str) -> str:
889889
str:
890890
Security token string.
891891
"""
892-
if not os.path.isfile(security_token_file):
892+
expanded_path = os.path.expanduser(security_token_file)
893+
if not os.path.isfile(expanded_path):
893894
raise ValueError("Invalid `security_token_file`. Specify a valid path.")
894895
try:
895896
token = None
896-
with open(security_token_file, 'r') as f:
897+
with open(expanded_path, 'r') as f:
897898
token = f.read()
898899
return token
899900
except:

0 commit comments

Comments
 (0)