Message285046
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. |
|
Date |
User |
Action |
Args |
2017-01-09 14:39:20 | vstinner | set | recipients:
+ vstinner, christian.heimes, socketpair |
2017-01-09 14:39:20 | vstinner | set | messageid: <1483972760.57.0.588557521728.issue29214@psf.upfronthosting.co.za> |
2017-01-09 14:39:20 | vstinner | link | issue29214 messages |
2017-01-09 14:39:20 | vstinner | create | |
|