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.

Author vstinner
Recipients christian.heimes, socketpair, vstinner
Date 2017-01-09.14:39:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483972760.57.0.588557521728.issue29214@psf.upfronthosting.co.za>
In-reply-to
Content
You can actually specify permission:

fd = os.open("document.txt", os.O_WRONLY | os.O_CREAT, 0o777)
fp = open(fd, "wb")
with fp:
   ...

You can also use the dir_fd parameter for even better security ;-)

Is your request for the standard open() function, rather than os.open()?

Note: io.FileIO(), the underlying object when calling the Python open(), calls the C open() function with 0o666 for the permission mode.
History
Date User Action Args
2017-01-09 14:39:20vstinnersetrecipients: + vstinner, christian.heimes, socketpair
2017-01-09 14:39:20vstinnersetmessageid: <1483972760.57.0.588557521728.issue29214@psf.upfronthosting.co.za>
2017-01-09 14:39:20vstinnerlinkissue29214 messages
2017-01-09 14:39:20vstinnercreate