Skip to content

Commit 63e5d4c

Browse files
committed
Don't set sticky bit on empty parent dir
connection file is in CWD, no need for sticky bits
1 parent aca211c commit 63e5d4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyter_client/connect.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ def write_connection_file(fname=None, shell_port=0, iopub_port=0, stdin_port=0,
139139
if hasattr(stat, 'S_ISVTX'):
140140
# set the sticky bit on the file and its parent directory
141141
# to avoid periodic cleanup
142-
for path in [fname, os.path.dirname(fname)]:
142+
paths = [fname]
143+
runtime_dir = os.path.dirname(fname)
144+
if runtime_dir:
145+
paths.append(runtime_dir)
146+
for path in paths:
143147
permissions = os.stat(path).st_mode
144148
new_permissions = permissions | stat.S_ISVTX
145149
if new_permissions != permissions:

0 commit comments

Comments
 (0)