Permalink
Browse files

Handle case where uid has no username

  • Loading branch information...
jtackaberry committed Oct 18, 2018
1 parent cf29852 commit 07b45cef7b77b22c67745a329e70ac3a1e2d5800
Showing with 5 additions and 1 deletion.
  1. +5 −1 stagehand/toolbox/utils.py
@@ -193,7 +193,11 @@ def get_temp_path(appname):
except KeyError:
# create tmp directory for the user
base = gettempdir()
path = os.path.join(base, '{}-{}'.format(appname, getpass.getuser()))
try:
user = getpass.getuser()
except Exception:
user = os.getuid()
path = os.path.join(base, '{}-{}'.format(appname, user))
if not os.path.isdir(path):
try:
os.mkdir(path, 0o0700)

0 comments on commit 07b45ce

Please sign in to comment.