def mkstemp(*args, **kwargs):
"""Wrap tempfile.mkstemp, setting the permissions of the created temporary
file as specified in settings (see bug 1983).
"""
fd, name = tempfile.mkstemp(*args, **kwargs)
if hasattr(os, 'fchmod'):
os.fchmod(fd, settings.POOTLE_SYNC_FILE_MODE)
else:
os.chmod(name, settings.POOTLE_SYNC_FILE_MODE)
return fd, name
评论列表
文章目录