This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tempfile.py TemporaryDirectory/mkdtemp defaults to mode 0o700, propose to add mode argument
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: ray-sit, serhiy.storchaka
Priority: normal Keywords:

Created on 2020-09-29 12:56 by ray-sit, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tempfile.py ray-sit, 2020-09-29 12:55
Pull Requests
URL Status Linked Edit
PR 22451 closed ray-sit, 2020-09-29 12:55
Messages (2)
msg377667 - (view) Author: Raymond Sit (ray-sit) * Date: 2020-09-29 12:55
`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.

Proposed Change is in the PR linked (https://github.com/python/cpython/pull/22451)
msg377668 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-09-29 13:20
You can change permissions after creating the directory.

The C function mkdtemp() creates the directory with permissions 0o700.
History
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86050
2020-12-31 04:23:39ray-sitsetstatus: open -> closed
resolution: wont fix
stage: resolved
2020-09-29 13:20:53serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg377668
2020-09-29 12:56:02ray-sitcreate