You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tempfile.py TemporaryDirectory/mkdtemp defaults to mode 0o700, propose to add mode argument #86050
tempfile.TemporaryDirectory always creates the directory with 0o700 permissions. So other applications which could run as a different user (i.e. root) cannot access the directory.
To improve the usability I would like to add the option to set the permissions of the directory.
A recent issue in the aws-cli (aws/aws-cli#9114) would benefit from having a mode argument in TemporaryDirectory/mkdtemp, but it seems this change is not being considered. Commenting to link the issue to other relevant threads. We will find a different workaround for the aws-cli issue.
Activity
ray-sit commentedon Sep 29, 2020
tempfile.TemporaryDirectoryalways creates the directory with 0o700 permissions. So other applications which could run as a different user (i.e. root) cannot access the directory.To improve the usability I would like to add the option to set the permissions of the directory.
Proposed Change is in the PR linked (#22451)
serhiy-storchaka commentedon Sep 29, 2020
You can change permissions after creating the directory.
The C function mkdtemp() creates the directory with permissions 0o700.
CharlesReinhardt commentedon Jan 9, 2025
A recent issue in the aws-cli (aws/aws-cli#9114) would benefit from having a mode argument in
TemporaryDirectory/mkdtemp, but it seems this change is not being considered. Commenting to link the issue to other relevant threads. We will find a different workaround for the aws-cli issue.