STINNER Victor added the comment: 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. ---------- nosy: +haypo _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29214> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com