set sticky bit on connection files by minrk · Pull Request #201 · jupyter/jupyter_client (original) (raw)

acc-16249 # python
Python 3.6.2 (default, Jul 25 2017, 11:20:33)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import stat
>>> path = '/var/folders/c5/sxpknfp571v3ydglf4305g9m0000gn/T'
>>> permissions = os.stat(path).st_mode
>>> new_permissions = permissions | stat.S_ISVTX
>>> os.chmod(path, new_permissions)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
PermissionError: [Errno 1] Operation not permitted: '/var/folders/c5/sxpknfp571v3ydglf4305g9m0000gn/T'